summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-09-12 09:26:24 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-09-12 11:01:46 +0100
commit259e827cb942e501a81ec0dcd047bb2bb8d37110 (patch)
treeadadbdf6565dcc9e6bfc45edf2cf30cf441afc6d
parent8f0cd571657751c8f64b9c5d91722c1297d8c798 (diff)
downloadxf86-video-armada-259e827cb942e501a81ec0dcd047bb2bb8d37110.tar.gz
vivante: vivante_fill() takes the boxes themselves rather than the region
Arrange for vivante_fill() to take the clip box and a list of boxes to operate on, rather than a region. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/vivante_accel.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index 82a7a58..f1ff49c 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -426,24 +426,16 @@ static const gctUINT8 vivante_fill_rop[] = {
* according to the clips in the GC.
*/
static Bool vivante_fill(struct vivante *vivante, struct vivante_pixmap *vPix,
- GCPtr pGC, RegionPtr region)
+ GCPtr pGC, const BoxRec *clipBox, const BoxRec *pBox, unsigned nBox,
+ int dx, int dy)
{
- const BoxRec *pBox, *b;
- unsigned nBox, chunk;
+ const BoxRec *b;
+ unsigned chunk;
gceSTATUS err;
gctUINT32 fg;
gctUINT8 rop;
gcsRECT *rects, *r, clip;
- if (RegionBroken(region)) {
- xf86DrvMsg(vivante->scrnIndex, X_ERROR,
- "[vivante] %s: broken region\n", __FUNCTION__);
- return FALSE;
- }
-
- nBox = RegionNumRects(region);
- pBox = RegionRects(region);
-
chunk = vivante->max_rect_count;
if (nBox < chunk)
chunk = nBox;
@@ -462,7 +454,7 @@ static Bool vivante_fill(struct vivante *vivante, struct vivante_pixmap *vPix,
vivante_disable_alpha_blend(vivante);
- RectBox(&clip, RegionExtents(region), 0, 0);
+ RectBox(&clip, clipBox, dx, dy);
err = gco2D_SetClipping(vivante->e2d, &clip);
if (err) {
vivante_error(vivante, "gco2D_SetClipping", err);
@@ -495,7 +487,7 @@ static Bool vivante_fill(struct vivante *vivante, struct vivante_pixmap *vPix,
chunk = nBox;
for (i = 0, r = rects; i < chunk; i++, r++, b++)
- RectBox(r, b, 0, 0);
+ RectBox(r, b, dx, dy);
err = gco2D_Blit(vivante->e2d, chunk, rects, rop, rop, vPix->format);
if (err)
@@ -604,10 +596,9 @@ Bool vivante_accel_FillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
/* Intersect them with the clipping region */
RegionIntersect(&region, &region, fbGetCompositeClip(pGC));
- /* Translate them for the drawable offset */
- RegionTranslate(&region, off_x, off_y);
-
- ret = vivante_fill(vivante, vPix, pGC, &region);
+ ret = vivante_fill(vivante, vPix, pGC, RegionExtents(&region),
+ RegionRects(&region), RegionNumRects(&region),
+ off_x, off_y);
RegionUninit(&region);
@@ -818,10 +809,9 @@ Bool vivante_accel_PolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
/* Intersect them with the clipping region */
RegionIntersect(&region, &region, fbGetCompositeClip(pGC));
- /* Translate them for the drawable offset */
- RegionTranslate(&region, off_x, off_y);
-
- ret = vivante_fill(vivante, vPix, pGC, &region);
+ ret = vivante_fill(vivante, vPix, pGC, RegionExtents(&region),
+ RegionRects(&region), RegionNumRects(&region),
+ off_x, off_y);
RegionUninit(&region);
@@ -853,10 +843,9 @@ Bool vivante_accel_PolyFillRectSolid(DrawablePtr pDrawable, GCPtr pGC, int n,
RegionIntersect(rects, rects, fbGetCompositeClip(pGC));
if (RegionNumRects(rects)) {
- /* Translate them for the drawable offset */
- RegionTranslate(rects, off_x, off_y);
-
- ret = vivante_fill(vivante, vPix, pGC, rects);
+ ret = vivante_fill(vivante, vPix, pGC, RegionExtents(rects),
+ RegionRects(rects), RegionNumRects(rects),
+ off_x, off_y);
} else {
ret = TRUE;
}