[cairo] Locking the source matrix
otaylor at redhat.com
Mon Aug 1 14:25:16 PDT 2005
On Mon, 2005-08-01 at 14:18 -0700, Carl Worth wrote:
> > Index: test/source-surface-scale-paint.c
> > ===================================================================
> > RCS file: /cvs/cairo/cairo/test/source-surface-scale-paint.c,v
> > retrieving revision 1.2
> > diff -u -p -r1.2 source-surface-scale-paint.c
> > --- test/source-surface-scale-paint.c 6 May 2005 20:23:41 -0000 1.2
> > +++ test/source-surface-scale-paint.c 1 Aug 2005 20:05:21 -0000
> > @@ -46,9 +46,10 @@ draw (cairo_t *cr, int width, int height
> > surface = cairo_image_surface_create_for_data ((unsigned char *) data,
> > CAIRO_FORMAT_ARGB32, 4, 4, 16);
> > - cairo_set_source_surface (cr, surface, 2, 2);
> > - cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
> > cairo_scale (cr, 2, 2);
> > + cairo_set_source_surface (cr, surface, 1, 1);
> > + cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
> > + cairo_identity_matrix (cr);
> > cairo_paint (cr);
> Changing the test to match the reference image was a nice try, but it
> won't do it here. The new version of the test above is now equivalent
> to what we're testing in scale-source-surface-paint.
> What we need instead is a test that sets a source, then changes the
> CTM, demonstrating that the original CTM was locked for the source. I
> think the original test code should do that, so we'll just need to
> verify that the result is correct. (And perhaps tweak the test to make
> a more pleasing result---eg. change the size so that the result is
Note the cairo_identity_matrix() ... the above does test changing the
matrix after setting the source surface. But I've reverted that now
and updated the reference image.
In CVS now.
2005-08-01 Owen Taylor <otaylor at redhat.com>
reviewed by: cworth
* src/cairo-gstate.c src/cairo-gstate-private.h: Store the
inverse CTM at the time of cairo_gstate_set_source() to
"lock" the user space matrix.
* src/cairo-gstate.c: Move the source pattern transformation
to the outside of _cairo_gstate_clip_and_composite_trapezoids()
instead of doing it at the leaves.
* test/source-surface-scale-paint.c: Change size of output
surface for aesthetics.
* test/source-surface-scale-paint-ref.png: Updated to correspond
to the current definition.
* test/Makefile.am (XFAIL_TESTS):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050801/5b600ff1/attachment.pgp
More information about the cairo