[cairo-commit] cairo/src cairo-clip.c,1.4,1.4.4.1
Tim Rowley
commit at pdx.freedesktop.org
Wed Oct 12 15:06:46 PDT 2005
Committed by: tor
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv2861/src
Modified Files:
Tag: BRANCH_1_0
cairo-clip.c
Log Message:
Reviewed by: cworth
* src/cairo-clip.c (_cairo_clip_intersect_mask): Intersect clip
region with target surface so we don't waste time and memory.
Index: cairo-clip.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-clip.c,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -u -d -r1.4 -r1.4.4.1
--- cairo-clip.c 17 Aug 2005 01:22:16 -0000 1.4
+++ cairo-clip.c 12 Oct 2005 22:06:44 -0000 1.4.4.1
@@ -319,7 +319,7 @@
{
cairo_pattern_union_t pattern;
cairo_box_t extents;
- cairo_rectangle_t surface_rect;
+ cairo_rectangle_t surface_rect, target_rect;
cairo_surface_t *surface;
cairo_status_t status;
@@ -333,6 +333,13 @@
if (clip->surface != NULL)
_cairo_rectangle_intersect (&surface_rect, &clip->surface_rect);
+ /* Intersect with the target surface rectangle so we don't use
+ * more memory and time than we need to. */
+
+ status = _cairo_surface_get_extents (target, &target_rect);
+ if (!status)
+ _cairo_rectangle_intersect (&surface_rect, &target_rect);
+
surface = _cairo_surface_create_similar_solid (target,
CAIRO_CONTENT_ALPHA,
surface_rect.width,
More information about the cairo-commit
mailing list