diff options
author | Dave Airlie <airlied@redhat.com> | 2012-10-08 11:20:14 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-10-08 11:20:14 +1000 |
commit | b08abdcada60e0c935b3e5e6ed615a9d3005398b (patch) | |
tree | 642debe911f1d21d50f2441fa85b9c0f84d218a1 | |
parent | 352bbd5bf821f5beca49cb4940c3a65b0a864bd1 (diff) |
more misc pict cleanups
-rw-r--r-- | dix/impedance.c | 3 | ||||
-rw-r--r-- | render/impedpict.c | 45 |
2 files changed, 23 insertions, 25 deletions
diff --git a/dix/impedance.c b/dix/impedance.c index b638a2fac..75dde7e0e 100644 --- a/dix/impedance.c +++ b/dix/impedance.c @@ -979,9 +979,6 @@ impedSetupScreen(ScreenPtr pScreen) pScreen->BitmapToRegion = impedBitmapToRegion; - /* replace miCloseScreen */ - - // drvmiSetZeroLineBias(pScreen, DEFAULTZEROLINEBIAS); return TRUE; } diff --git a/render/impedpict.c b/render/impedpict.c index 96a683817..3aecf1b9f 100644 --- a/render/impedpict.c +++ b/render/impedpict.c @@ -25,18 +25,18 @@ impedComposite (CARD8 op, CARD16 width, CARD16 height) { - int x_off, y_off; - PixmapPtr pSrcPixmap = NULL, pDstPixmap, pMaskPixmap = NULL; PicturePtr pDrvSrc, pDrvMask = NULL, pDrvDst; ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); int i = pScreen->primary_gpu_index; PictureScreenPtr drv_ps; miCompositeSourceValidate (pSrc); if (pMask) miCompositeSourceValidate (pMask); - - pDrvSrc = pSrc->gpu[i]; + + if (pSrc->pScreen) + pDrvSrc = pSrc->gpu[i]; + else + pDrvSrc = pSrc; pDrvDst = pDst->gpu[i]; if (pMask) pDrvMask = pMask->gpu[i]; @@ -53,13 +53,11 @@ impedRasterizeTrapezoid (PicturePtr pPicture, int y_off) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PixmapPtr pPixmap = GetDrawablePixmap(pScreen, pPicture->pDrawable); PicturePtr pDrvPicture; PictureScreenPtr drv_ps; - int i; + int i = pScreen->primary_gpu_index; - // pDrvPicture = pPicture->gpu[i]; - // pDrvPicture->pDrawable = &pPixmap->gpu[i]->drawable; + pDrvPicture = pPicture->gpu[i]; drv_ps = GetPictureScreen(pScreen->gpu[i]); drv_ps->RasterizeTrapezoid(pDrvPicture, trap, x_off, y_off); @@ -74,9 +72,10 @@ impedAddTraps (PicturePtr pPicture, { PictureScreenPtr drv_ps; ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PixmapPtr pPixmap = GetDrawablePixmap(pScreen, pPicture->pDrawable); PicturePtr pDrvPicture; - int i = 0; + int i = pScreen->primary_gpu_index; + + pDrvPicture = pPicture->gpu[i]; drv_ps = GetPictureScreen(pScreen->gpu[i]); drv_ps->AddTraps(pDrvPicture, x_off, y_off, ntrap, traps); @@ -240,12 +239,14 @@ impedChangePicture(PicturePtr pPicture, Mask mask) if (!pPicture->pDrawable) return; + + pScreen = pPicture->pDrawable->pScreen; + i = pScreen->primary_gpu_index; + if (!pPicture->gpu[i]) return; - pScreen = pPicture->pDrawable->pScreen; - for (i = 0; i < pScreen->num_gpu; i++) { - impedChangeOnePicture(pPicture, pPicture->gpu[i], i, mask); - } + + impedChangeOnePicture(pPicture, pPicture->gpu[i], i, mask); } static int @@ -253,7 +254,7 @@ impedCreatePicture (PicturePtr pPicture) { ScreenPtr pScreen = pPicture->pScreen; PictureScreenPtr ps; - int i; + int i = pScreen->primary_gpu_index; PixmapPtr pPixmap; int x_off = 0, y_off = 0; int error; @@ -272,13 +273,13 @@ impedCreatePicture (PicturePtr pPicture) RegionTranslate(pPicture->pCompositeClip, x_off, y_off); } #endif - for (i = 0; i < pScreen->num_gpu; i++) { - pPicture->gpu[i] = CreatePicture(0, &pPixmap->gpu[i]->drawable, pPicture->pFormat, - 0, 0, serverClient, &error); - if (!pPicture->gpu[i]) - ErrorF("no gpu %d picture\n", i); + pPicture->gpu[i] = CreatePicture(0, &pPixmap->gpu[i]->drawable, pPicture->pFormat, + 0, 0, serverClient, &error); + if (!pPicture->gpu[i]) + ErrorF("no gpu %d picture\n", i); + else impedChangeOnePicture(pPicture, pPicture->gpu[i], i, 0xffffffff); - } + #ifdef COMPOSITE if (x_off || y_off) { RegionTranslate(pPicture->pCompositeClip, -x_off, -y_off); |