From bd0ea43f3999e29ae5953ca5257b1795916dd5e7 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Tue, 23 Aug 2011 13:27:48 +0800 Subject: [PATCH] glamor: Change to use the original drawable in glamor_fill. As glamor_fill may fallback to software rasterization, we'd better to use the original drawable as input paramter. Signed-off-by: Zhigang Gong --- glamor/glamor_fill.c | 19 +++++++++++-------- glamor/glamor_fillspans.c | 6 +----- glamor/glamor_polyfillrect.c | 7 ++----- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c index 873f383a5..cbd2b59f6 100644 --- a/glamor/glamor_fill.c +++ b/glamor/glamor_fill.c @@ -41,12 +41,15 @@ glamor_fill(DrawablePtr drawable, int height) { PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(drawable); + int off_x, off_y; + + glamor_get_drawable_deltas(drawable, dst_pixmap, &off_x, &off_y); switch (gc->fillStyle) { case FillSolid: if (!glamor_solid(dst_pixmap, - x, - y, + x + off_x, + y + off_y, width, height, gc->alu, @@ -58,8 +61,8 @@ glamor_fill(DrawablePtr drawable, case FillOpaqueStippled: if (!glamor_stipple(dst_pixmap, gc->stipple, - x, - y, + x + off_x, + y + off_y, width, height, gc->alu, @@ -74,14 +77,14 @@ glamor_fill(DrawablePtr drawable, case FillTiled: if (!glamor_tile(dst_pixmap, gc->tile.pixmap, - x, - y, + x + off_x, + y + off_y, width, height, gc->alu, gc->planemask, - drawable->x + x - gc->patOrg.x, - drawable->y + y - gc->patOrg.y)) + drawable->x + x + off_x - gc->patOrg.x, + drawable->y + y + off_y - gc->patOrg.y)) goto fail; break; } diff --git a/glamor/glamor_fillspans.c b/glamor/glamor_fillspans.c index b1f79a9d8..9a97da250 100644 --- a/glamor/glamor_fillspans.c +++ b/glamor/glamor_fillspans.c @@ -42,15 +42,11 @@ glamor_fill_spans(DrawablePtr drawable, int nbox; BoxPtr pbox; int x1, x2, y; - int off_x, off_y; RegionPtr pClip = fbGetCompositeClip(gc); - PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); - if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled) goto fail; - glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); ppt = points; while (n--) { x1 = ppt->x; @@ -74,7 +70,7 @@ glamor_fill_spans(DrawablePtr drawable, if (x2 <= x1) continue; glamor_fill (drawable,gc, - x1 + off_x, y + off_y, + x1, y, x2 - x1 , 1); pbox++; } diff --git a/glamor/glamor_polyfillrect.c b/glamor/glamor_polyfillrect.c index 218c308dd..3cc4b527d 100644 --- a/glamor/glamor_polyfillrect.c +++ b/glamor/glamor_polyfillrect.c @@ -47,16 +47,13 @@ glamor_poly_fill_rect(DrawablePtr drawable, int xorg, yorg; int n; register BoxPtr pbox; - int off_x, off_y; RegionPtr pClip = fbGetCompositeClip(gc); - PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled) { goto fail; } xorg = drawable->x; yorg = drawable->y; - glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); while (nrect--) { fullX1 = prect->x + xorg; @@ -92,8 +89,8 @@ glamor_poly_fill_rect(DrawablePtr drawable, continue; glamor_fill(drawable, gc, - x1 + off_x, - y1 + off_y, + x1, + y1, x2 - x1, y2 - y1); }