diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-23 18:32:12 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-23 18:33:00 +0000 |
commit | 74374fce9d71d373287cddc3a0bf4aaf4bda568b (patch) | |
tree | 7daed1216e6592fbb7c54da6583c66a0b314c634 /src | |
parent | 5809c6ff32b10c7c07ae96e5b0f7b98de66ecea5 (diff) |
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@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-xcb-surface-render.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c index 728c8a347..83e9db80a 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) |