xcb: Fix a BadPicture when clearing a surface

This bug was introduced in 6f431886 "xcb: Prefer RenderFillRectangles to perform
the deferred clear". The problem is that we are trying to clear a surface before
we created a Picture for it. This resulted in a FillRectangles call with
dst=XCB_NONE.

I noticed this problem via cairo-perf-micro's dragon-solid-circle-clip.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-01-23 22:10:20 +01:00
parent 74374fce9d
commit c7b16098bd

View file

@ -2292,6 +2292,7 @@ _cairo_xcb_surface_clear (cairo_xcb_surface_t *dst)
if (dst->flags & CAIRO_XCB_RENDER_HAS_COMPOSITE) {
xcb_render_color_t transparent = { 0 };
_cairo_xcb_surface_ensure_picture (dst);
_cairo_xcb_connection_render_fill_rectangles (dst->connection,
XCB_RENDER_PICT_OP_CLEAR,
dst->picture,