diff options
author | Eric Anholt <eric@anholt.net> | 2009-07-09 19:24:38 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-07-22 09:15:59 -0700 |
commit | 5ef3db45e059df136162584d00d4b0b511456a33 (patch) | |
tree | 03839db1d6fe301b8cb2d968ec98dd96a547f615 /uxa | |
parent | 6f3fc6b20f3daedab02e31f49678d4d2ff0fa7a3 (diff) |
uxa: Skip fill of temporary alpha picture that just gets copied over.
This was needed when we were doing the mask computations in this pixmap,
but now they're done in a temporary and then uploaded later.
This reduces runtime of firefox-20090601 from 52.6 (+/- .96%) to 50.7
(+/- .41%) seconds on my G45.
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa-render.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index 33af6364..02373b0b 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -806,9 +806,7 @@ uxa_create_alpha_picture (ScreenPtr pScreen, { PixmapPtr pPixmap; PicturePtr pPicture; - GCPtr pGC; int error; - xRectangle rect; if (width > 32767 || height > 32767) return 0; @@ -827,19 +825,6 @@ uxa_create_alpha_picture (ScreenPtr pScreen, pPictFormat->depth, 0); if (!pPixmap) return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - uxa_check_poly_fill_rect (&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, 0, 0, serverClient, &error); (*pScreen->DestroyPixmap) (pPixmap); @@ -950,6 +935,7 @@ uxa_trapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, FreePicture (pPicture, 0); return; } + ValidateGC (pPicture->pDrawable, pGC); (*pGC->ops->CopyArea) (&pPixmap->drawable, pPicture->pDrawable, pGC, 0, 0, width, height, 0, 0); @@ -1023,16 +1009,33 @@ uxa_triangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst, PicturePtr pPicture; INT16 xDst, yDst; INT16 xRel, yRel; - + int width = bounds.x2 - bounds.x1; + int height = bounds.y2 - bounds.y1; + GCPtr pGC; + xRectangle rect; + xDst = tris[0].p1.x >> 16; yDst = tris[0].p1.y >> 16; pPicture = uxa_create_alpha_picture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); + width, height); if (!pPicture) return; + /* Clear the alpha picture to 0. */ + pGC = GetScratchGC (pPicture->pDrawable->depth, pScreen); + if (!pGC) { + FreePicture (pPicture, 0); + return; + } + ValidateGC (pPicture->pDrawable, pGC); + rect.x = 0; + rect.y = 0; + rect.width = width; + rect.height = height; + uxa_check_poly_fill_rect (pPicture->pDrawable, pGC, 1, &rect); + FreeScratchGC (pGC); + if (uxa_prepare_access(pPicture->pDrawable, UXA_ACCESS_RW)) { (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris); uxa_finish_access(pPicture->pDrawable); |