[cairo-bugs] [Bug 15367] New: Improve filtering handling in cairo-pattern.c

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 5 08:47:00 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=15367

           Summary: Improve filtering handling in cairo-pattern.c
           Product: cairo
           Version: 1.5.17
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: otaylor at redhat.com
         QAContact: cairo-bugs at cairographics.org


This is an evolution of the patch attached in bug 15439 to special
case pixel-exact transformations when adding the bounds; it also
actually applies the => NEAREST optimization in
_cairo_pattern_acquire_surface().

Analyzing that for safety (usage in non-pixel-based backens) turned
up some odd code in cairo-svg-surface.c and cairo-win32-printing-surface.c:

- They called _cairo_pattern_acquire_surface() only for surface patterns
- A hack had been added so they could pass -1,-1 for width/height 
  and get the entire source surface
- The ignored the attributes result from the function

At that point they could just use pattern->surface directly instead,
there was no point in calling cairo_pattern_acquire_surface() at all.

The patch also removes the hack, since it doesn't seem consistent
with other internal API's in cairo and I can't find any other usages.

Suggest this for after 1.6.

commit 40847798271f9b8986cf90560dd1438fd8772847
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Sat Apr 5 11:34:27 2008 -0400

    Clean up handling of filter radius; optimize filter when possible
    cairo-pattern.c:
     - Factor out filter analysis code from _cairo_pattern_get_extents()
       and use it in _cairo_pattern_acquire_surface_for_surface() as well.
     - Optimize the filter to NEAREST when the matrix takes source
       pixels exactly onto destination pixels
    cairo-matrix.c cairoint.h: Add _cairo_matrix_is_pixel_exact()
    cairo-svg-surface.c cairo-win32-printing-surface.c: Remove
     instances of calling _cairo_pattern_acquire_surface() on
     a known-surface-pattern with a hack to say "give me the
     entire surface". If you know you just want the entire surface
     as an image surface, that can be done more simply.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list