summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-09-12 10:39:43 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-09-12 11:01:47 +0100
commitafebe57a568e3dbaf58ceebbe490688120a87d0e (patch)
treed3d070e529e898e1cf39d82d9d4d3020d999c7ec
parent2e9ef86fd1a03d6f0c54cf05022031e697c6ce81 (diff)
downloadxf86-video-armada-afebe57a568e3dbaf58ceebbe490688120a87d0e.tar.gz
vivante: move extraction of foreground colour to separate function
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/vivante_accel.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index 2f5d101..f12db78 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -421,6 +421,15 @@ static const gctUINT8 vivante_fill_rop[] = {
/* GXset */ 0xff // ROP_WHITE
};
+static uint32_t vivante_fg_col(GCPtr pGC)
+{
+ if (pGC->fillStyle == FillTiled)
+ return pGC->tileIsPixel ? pGC->tile.pixel :
+ get_first_pixel(&pGC->tile.pixmap->drawable);
+ else
+ return pGC->fgPixel;
+}
+
/*
* Generic solid-like blit fill - takes a set of boxes, and fills them
* according to the clips in the GC.
@@ -462,15 +471,7 @@ static Bool vivante_fill(struct vivante *vivante, struct vivante_pixmap *vPix,
return FALSE;
}
- if (pGC->fillStyle == FillTiled) {
- if (pGC->tileIsPixel)
- fg = pGC->tile.pixel;
- else
- fg = get_first_pixel(&pGC->tile.pixmap->drawable);
- } else {
- fg = pGC->fgPixel;
- }
-
+ fg = vivante_fg_col(pGC);
err = gco2D_LoadSolidBrush(vivante->e2d, vPix->format, 0, fg, ~0ULL);
if (err != gcvSTATUS_OK) {
vivante_error(vivante, "gco2D_LoadSolidBrush", err);