diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-13 15:11:16 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-13 17:17:54 +0100 |
commit | d1bd14e8b6754ba9f797642e1b33bf689e19417b (patch) | |
tree | 54d23aa2b6535762e47b52ba41c3029be737abcc /uxa | |
parent | cdab72c405434ecbf7a79e402ff2d65d6a728179 (diff) |
uxa: Replace source for CLEAR with a transparent solid
This means that we will hit the faster try_solid_fill path instead.
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa-render.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index 06bd9cee..0ba8b9d6 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -559,6 +559,21 @@ uxa_create_solid(ScreenPtr screen, uint32_t color) } static PicturePtr +uxa_solid_clear(ScreenPtr screen) +{ + uxa_screen_t *uxa_screen = uxa_get_screen(screen); + PicturePtr picture; + + if (!uxa_screen->solid_clear) { + uxa_screen->solid_clear = uxa_create_solid(screen, 0); + if (!uxa_screen->solid_clear) + return 0; + } + picture = uxa_screen->solid_clear; + return picture; +} + +static PicturePtr uxa_acquire_solid(ScreenPtr screen, SourcePict *source) { uxa_screen_t *uxa_screen = uxa_get_screen(screen); @@ -567,12 +582,10 @@ uxa_acquire_solid(ScreenPtr screen, SourcePict *source) int i; if ((solid->color >> 24) == 0) { - if (!uxa_screen->solid_clear) { - uxa_screen->solid_clear = uxa_create_solid(screen, 0); - if (!uxa_screen->solid_clear) - return 0; - } - picture = uxa_screen->solid_clear; + picture = uxa_solid_clear(screen); + if (!picture) + return 0; + goto DONE; } else if (solid->color == 0xff000000) { if (!uxa_screen->solid_black) { @@ -1335,6 +1348,16 @@ uxa_composite(CARD8 op, pSrc->repeat = 0; if (!pMask) { + if (op == PictOpClear) { + PicturePtr clear = uxa_solid_clear(pDst->pDrawable->pScreen); + if (clear && + uxa_try_driver_solid_fill(clear, pDst, + xSrc, ySrc, + xDst, yDst, + width, height) == 1) + goto done; + } + if (pSrc->pDrawable == NULL) { if (pSrc->pSourcePict) { SourcePict *source = pSrc->pSourcePict; |