diff --git a/glamor/glamor.h b/glamor/glamor.h index e98d7d5a5..ce1a41f9f 100644 --- a/glamor/glamor.h +++ b/glamor/glamor.h @@ -85,4 +85,8 @@ extern _X_EXPORT Bool glamor_fill_spans_nf(DrawablePtr drawable, int n, DDXPointPtr points, int *widths, int sorted); +extern _X_EXPORT Bool glamor_poly_fill_rect_nf(DrawablePtr drawable, + GCPtr gc, + int nrect, + xRectangle * prect); diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c index 5fc350ba8..b20ec5e39 100644 --- a/glamor/glamor_fill.c +++ b/glamor/glamor_fill.c @@ -144,7 +144,7 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, GLfloat color[4]; float vertices[8]; GLfloat xscale, yscale; - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) { + if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) { glamor_fallback("dest %p has no fbo.\n", pixmap); goto fail; } diff --git a/glamor/glamor_polyfillrect.c b/glamor/glamor_polyfillrect.c index eff63b6c0..44df8a80f 100644 --- a/glamor/glamor_polyfillrect.c +++ b/glamor/glamor_polyfillrect.c @@ -37,9 +37,9 @@ * GC PolyFillRect implementation, taken straight from fb_fill.c */ -void -glamor_poly_fill_rect(DrawablePtr drawable, - GCPtr gc, int nrect, xRectangle * prect) +static Bool +_glamor_poly_fill_rect(DrawablePtr drawable, + GCPtr gc, int nrect, xRectangle * prect, Bool fallback) { int fullX1, fullX2, fullY1, fullY2; int xorg, yorg; @@ -87,13 +87,14 @@ glamor_poly_fill_rect(DrawablePtr drawable, if (x1 >= x2 || y1 >= y2) continue; if (!glamor_fill(drawable, gc, x1, y1, x2 - x1, - y2 - y1, TRUE)) + y2 - y1, fallback)) goto fail; } } - return; + return TRUE; fail: + if (!fallback) return FALSE; glamor_fallback(" to %p (%c)\n", drawable, glamor_get_drawable_location(drawable)); if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) { @@ -103,5 +104,20 @@ glamor_poly_fill_rect(DrawablePtr drawable, } glamor_finish_access(drawable); } - return; + return TRUE; +} + + +void +glamor_poly_fill_rect(DrawablePtr drawable, + GCPtr gc, int nrect, xRectangle * prect) +{ + _glamor_poly_fill_rect(drawable, gc, nrect, prect, TRUE); +} + +Bool +glamor_poly_fill_rect_nf(DrawablePtr drawable, + GCPtr gc, int nrect, xRectangle * prect) +{ + return _glamor_poly_fill_rect(drawable, gc, nrect, prect, FALSE); }