[cairo-commit] src/cairo-xcb-surface-render.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Jan 23 10:33:53 PST 2011
src/cairo-xcb-surface-render.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 74374fce9d71d373287cddc3a0bf4aaf4bda568b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jan 23 18:32:12 2011 +0000
xcb: Only use clip rectangles for more than 1 pixel-aligned box
If there is only a single box, then it is naturally equivalent to the
single call to Composite. So need to incur the addition protocol
overhead of setting up the CompositeClip.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 728c8a3..83e9db8 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -1491,11 +1491,13 @@ _render_composite_boxes (cairo_xcb_surface_t *dst,
}
if (num_boxes) {
- _cairo_xcb_connection_render_set_picture_clip_rectangles(dst->connection,
- dst->picture,
- 0, 0,
- num_boxes,
- clip_boxes);
+ if (num_boxes > 1) {
+ _cairo_xcb_connection_render_set_picture_clip_rectangles(dst->connection,
+ dst->picture,
+ 0, 0,
+ num_boxes,
+ clip_boxes);
+ }
if (mask_pattern != NULL) {
mask = _cairo_xcb_picture_for_pattern (dst, mask_pattern, extents);
@@ -1527,7 +1529,8 @@ _render_composite_boxes (cairo_xcb_surface_t *dst,
extents->width, extents->height);
}
- _cairo_xcb_surface_clear_clip_region (dst);
+ if (num_boxes > 1)
+ _cairo_xcb_surface_clear_clip_region (dst);
}
if (clip_boxes != stack_boxes)
More information about the cairo-commit
mailing list