[cairo] [PATCH] filtering value preservation

Carl Worth cworth at east.isi.edu
Thu Jan 29 10:27:01 PST 2004

On Jan 27, graydon hoare wrote:
 > this patch makes the functions which create "similar surfaces" preserve 
 > the filter value of a surface. without it, compositing an image surface 
 > against an xlib surface always uses nearest neighbour filtering, since 
 > the xlib surface pushes a copy of the image to the X server, and drops 
 > the surface's filter setting. once applied, it uses the surface's setting.
 > comments? ok to commit?

Thanks for reporting this bug.

The patch needs to initialize surface->filter in _cairo_surface_init.

Also, if we want to do this, it seems we would want to copy the matrix
and repeat values as well. And, to do all that, there should be a new
shared function in cairo_surface.c so that the code would not have to
be repeated in all backends, (cf. _cairo_surface_init).

But, I don't think we actually want the "create_similar" interface to
clone so much of the original surface[*]. Instead, I think we do want
the new surface->filter field and cairo_surface_get_filter. Then,
instead of copying this in create_similar, I think the code that is
creating the temporary copy should copy the filter parameter over as

Does that make sense?


[*] For create_similar, the original intent was just to create a
surface using the same backend as the original. I think the function
likely needs to be renamed as what we really want is a
"create_scratch" which does not necessarily create a surface of the
same backend, but creates one of unknown type, (but guaranteed to be
usable to composite back onto the original).

Also, I think I want to remove the get/set of repeat, filter, and
matrix from the public "object-like" surface API, and instead move
them to cairo_t functions that would operate on the "current
pattern". The idea here is to keep rendering state in the cairo_t
state object, and not sprinkled throughout various objects.

More information about the cairo mailing list