[cairo-commit] src/cairo-xcb-surface-render.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Jan 23 05:30:20 PST 2011
src/cairo-xcb-surface-render.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
New commits:
commit 6f4318869cf551f4ed349459b7afd50e4b10941c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jan 23 13:29:51 2011 +0000
xcb: Prefer RenderFillRectangles to perform the deferred clear
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 0b76e8e..728c8a3 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -2282,17 +2282,27 @@ _cairo_xcb_surface_clear (cairo_xcb_surface_t *dst)
if (unlikely (status))
return status;
- gc = _cairo_xcb_screen_get_gc (dst->screen, dst->drawable, dst->depth);
-
rect.x = rect.y = 0;
rect.width = dst->width;
rect.height = dst->height;
- _cairo_xcb_connection_poly_fill_rectangle (dst->connection,
- dst->drawable, gc,
- 1, &rect);
+ if (dst->flags & CAIRO_XCB_RENDER_HAS_COMPOSITE) {
+ xcb_render_color_t transparent = { 0 };
+
+ _cairo_xcb_connection_render_fill_rectangles (dst->connection,
+ XCB_RENDER_PICT_OP_CLEAR,
+ dst->picture,
+ transparent,
+ 1, &rect);
+ } else {
+ gc = _cairo_xcb_screen_get_gc (dst->screen, dst->drawable, dst->depth);
+
+ _cairo_xcb_connection_poly_fill_rectangle (dst->connection,
+ dst->drawable, gc,
+ 1, &rect);
- _cairo_xcb_screen_put_gc (dst->screen, dst->depth, gc);
+ _cairo_xcb_screen_put_gc (dst->screen, dst->depth, gc);
+ }
_cairo_xcb_connection_release (dst->connection);
More information about the cairo-commit
mailing list