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 <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2011-08-23 13:27:48 +08:00
parent 65812b538f
commit bd0ea43f39
3 changed files with 14 additions and 18 deletions

View File

@ -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;
}

View File

@ -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++;
}

View File

@ -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);
}