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:
parent
65812b538f
commit
bd0ea43f39
|
@ -41,12 +41,15 @@ glamor_fill(DrawablePtr drawable,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(drawable);
|
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) {
|
switch (gc->fillStyle) {
|
||||||
case FillSolid:
|
case FillSolid:
|
||||||
if (!glamor_solid(dst_pixmap,
|
if (!glamor_solid(dst_pixmap,
|
||||||
x,
|
x + off_x,
|
||||||
y,
|
y + off_y,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
gc->alu,
|
gc->alu,
|
||||||
|
@ -58,8 +61,8 @@ glamor_fill(DrawablePtr drawable,
|
||||||
case FillOpaqueStippled:
|
case FillOpaqueStippled:
|
||||||
if (!glamor_stipple(dst_pixmap,
|
if (!glamor_stipple(dst_pixmap,
|
||||||
gc->stipple,
|
gc->stipple,
|
||||||
x,
|
x + off_x,
|
||||||
y,
|
y + off_y,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
gc->alu,
|
gc->alu,
|
||||||
|
@ -74,14 +77,14 @@ glamor_fill(DrawablePtr drawable,
|
||||||
case FillTiled:
|
case FillTiled:
|
||||||
if (!glamor_tile(dst_pixmap,
|
if (!glamor_tile(dst_pixmap,
|
||||||
gc->tile.pixmap,
|
gc->tile.pixmap,
|
||||||
x,
|
x + off_x,
|
||||||
y,
|
y + off_y,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
gc->alu,
|
gc->alu,
|
||||||
gc->planemask,
|
gc->planemask,
|
||||||
drawable->x + x - gc->patOrg.x,
|
drawable->x + x + off_x - gc->patOrg.x,
|
||||||
drawable->y + y - gc->patOrg.y))
|
drawable->y + y + off_y - gc->patOrg.y))
|
||||||
goto fail;
|
goto fail;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,15 +42,11 @@ glamor_fill_spans(DrawablePtr drawable,
|
||||||
int nbox;
|
int nbox;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
int x1, x2, y;
|
int x1, x2, y;
|
||||||
int off_x, off_y;
|
|
||||||
RegionPtr pClip = fbGetCompositeClip(gc);
|
RegionPtr pClip = fbGetCompositeClip(gc);
|
||||||
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
|
|
||||||
|
|
||||||
|
|
||||||
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled)
|
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
|
|
||||||
ppt = points;
|
ppt = points;
|
||||||
while (n--) {
|
while (n--) {
|
||||||
x1 = ppt->x;
|
x1 = ppt->x;
|
||||||
|
@ -74,7 +70,7 @@ glamor_fill_spans(DrawablePtr drawable,
|
||||||
if (x2 <= x1)
|
if (x2 <= x1)
|
||||||
continue;
|
continue;
|
||||||
glamor_fill (drawable,gc,
|
glamor_fill (drawable,gc,
|
||||||
x1 + off_x, y + off_y,
|
x1, y,
|
||||||
x2 - x1 , 1);
|
x2 - x1 , 1);
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,16 +47,13 @@ glamor_poly_fill_rect(DrawablePtr drawable,
|
||||||
int xorg, yorg;
|
int xorg, yorg;
|
||||||
int n;
|
int n;
|
||||||
register BoxPtr pbox;
|
register BoxPtr pbox;
|
||||||
int off_x, off_y;
|
|
||||||
RegionPtr pClip = fbGetCompositeClip(gc);
|
RegionPtr pClip = fbGetCompositeClip(gc);
|
||||||
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
|
|
||||||
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled) {
|
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
xorg = drawable->x;
|
xorg = drawable->x;
|
||||||
yorg = drawable->y;
|
yorg = drawable->y;
|
||||||
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
|
|
||||||
|
|
||||||
while (nrect--) {
|
while (nrect--) {
|
||||||
fullX1 = prect->x + xorg;
|
fullX1 = prect->x + xorg;
|
||||||
|
@ -92,8 +89,8 @@ glamor_poly_fill_rect(DrawablePtr drawable,
|
||||||
continue;
|
continue;
|
||||||
glamor_fill(drawable,
|
glamor_fill(drawable,
|
||||||
gc,
|
gc,
|
||||||
x1 + off_x,
|
x1,
|
||||||
y1 + off_y,
|
y1,
|
||||||
x2 - x1,
|
x2 - x1,
|
||||||
y2 - y1);
|
y2 - y1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue