mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-08 06:58:18 +02:00
xcb: Prefer RenderFillRectangles to perform the deferred clear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
bef8b28300
commit
6f4318869c
1 changed files with 16 additions and 6 deletions
|
|
@ -2282,17 +2282,27 @@ _cairo_xcb_surface_clear (cairo_xcb_surface_t *dst)
|
||||||
if (unlikely (status))
|
if (unlikely (status))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
gc = _cairo_xcb_screen_get_gc (dst->screen, dst->drawable, dst->depth);
|
|
||||||
|
|
||||||
rect.x = rect.y = 0;
|
rect.x = rect.y = 0;
|
||||||
rect.width = dst->width;
|
rect.width = dst->width;
|
||||||
rect.height = dst->height;
|
rect.height = dst->height;
|
||||||
|
|
||||||
_cairo_xcb_connection_poly_fill_rectangle (dst->connection,
|
if (dst->flags & CAIRO_XCB_RENDER_HAS_COMPOSITE) {
|
||||||
dst->drawable, gc,
|
xcb_render_color_t transparent = { 0 };
|
||||||
1, &rect);
|
|
||||||
|
|
||||||
_cairo_xcb_screen_put_gc (dst->screen, dst->depth, gc);
|
_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_connection_release (dst->connection);
|
_cairo_xcb_connection_release (dst->connection);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue