From c7227a88ada234f7316aad1992fa77bcf119b407 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 29 Oct 2013 12:28:05 +0000 Subject: Avoid setting up a brush when none is required Our blit copies do not make use of the brush, so it's pointless setting one up each time. Avoid this to reduce the overhead of setting up blit copies. Signed-off-by: Russell King --- src/vivante_accel.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/vivante_accel.c b/src/vivante_accel.c index f86a35f..d7d9fa5 100644 --- a/src/vivante_accel.c +++ b/src/vivante_accel.c @@ -442,6 +442,7 @@ static Bool vivante_fill(struct vivante *vivante, struct vivante_pixmap *vPix, } else { fg = pGC->fgPixel; } + err = gco2D_LoadSolidBrush(vivante->e2d, vPix->format, 0, fg, ~0ULL); if (err != gcvSTATUS_OK) { vivante_error(vivante, "gco2D_LoadSolidBrush", err); @@ -644,11 +645,7 @@ Bool vivante_accel_PutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, goto unmap; } - err = gco2D_LoadSolidBrush(vivante->e2d, vPix->format, 0, 0, ~0ULL); - if (err != gcvSTATUS_OK) { - vivante_error(vivante, "LoadSolidBrush", err); - goto unmap; - } + /* No need to load the brush here - the blit copy doesn't use it. */ total.x1 = x; total.y1 = y; @@ -726,11 +723,7 @@ void vivante_accel_CopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, vivante_disable_alpha_blend(vivante); - err = gco2D_LoadSolidBrush(vivante->e2d, vDst->format, 0, 0, ~0ULL); - if (err != gcvSTATUS_OK) { - what = "LoadSolidBrush"; - goto fallback_msg; - } + /* No need to load the brush here - the blit copy doesn't use it. */ err = gco2D_SetColorSourceAdvanced(vivante->e2d, vSrc->handle, vSrc->pitch, vSrc->format, gcvSURF_0_DEGREE, -- cgit