[cairo-commit] cairo/src cairo.c,1.81,1.82

Carl Worth commit at pdx.freedesktop.org
Tue Apr 26 19:04:50 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv1034/src

Modified Files:
	cairo.c 
Log Message:

        * src/cairo.c (cairo_paint): Build rectangle with an identity
        matrix in place so that the entire target surface will be filled
        even when there is a transformation in place.


Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- cairo.c	26 Apr 2005 19:38:06 -0000	1.81
+++ cairo.c	27 Apr 2005 02:04:48 -0000	1.82
@@ -1495,10 +1495,24 @@
     if (cr->status)
 	return;
 
+    /* Use an indentity matrix, but only while creating the path,
+     * since _cairo_gstate_get_clip_extents returns a rectangle in
+     * device space. Using an identity matrix simply saves a pair of
+     * conversions from device to user space then back again.
+     *
+     * The identity matrix is not used for the fill so that the source
+     * will be properly transformed.
+     */
+
+    cairo_save (cr);
+    cairo_identity_matrix (cr);
+
     cairo_rectangle (cr,
 		     rectangle.x, rectangle.y,
 		     rectangle.width, rectangle.height);
 
+    cairo_restore (cr);
+
     cairo_fill (cr);
 
     CAIRO_CHECK_SANITY (cr);




More information about the cairo-commit mailing list