diff options
author | Eric Anholt <eric@anholt.net> | 2009-06-03 10:00:50 +0000 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-03 10:19:25 +0000 |
commit | 5901a67fc85ac80fabfa98b78202a388445275c3 (patch) | |
tree | 2d78e744bbeaac183211b5ca2f70a33446d3296e | |
parent | 5e48146777921b693c828af9566a77422cc4f85f (diff) |
Fix some drawable abuse in i830_dri.c
We were casting pixmaps to drawables even if they weren't pixmaps. They did
happen to work out since we only used the drawable record out of them.
-rw-r--r-- | src/i830_dri.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index 8b2629f0..667f687e 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -285,10 +285,11 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, ScreenPtr pScreen = pDraw->pScreen; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; I830Ptr pI830 = I830PTR(pScrn); - PixmapPtr pSrcPixmap = (srcPrivate->attachment == DRI2BufferFrontLeft) - ? (PixmapPtr) pDraw : srcPrivate->pPixmap; - PixmapPtr pDstPixmap = (dstPrivate->attachment == DRI2BufferFrontLeft) - ? (PixmapPtr) pDraw : dstPrivate->pPixmap; + DrawablePtr src = (srcPrivate->attachment == DRI2BufferFrontLeft) + ? pDraw : &srcPrivate->pPixmap->drawable; + DrawablePtr dst = (dstPrivate->attachment == DRI2BufferFrontLeft) + ? pDraw : &dstPrivate->pPixmap->drawable; + PixmapPtr dst_pixmap = get_drawable_pixmap(dst); RegionPtr pCopyClip; GCPtr pGC; @@ -296,7 +297,7 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, pCopyClip = REGION_CREATE(pScreen, NULL, 0); REGION_COPY(pScreen, pCopyClip, pRegion); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pCopyClip, 0); - ValidateGC(&pDstPixmap->drawable, pGC); + ValidateGC(dst, pGC); /* Wait for the scanline to be outside the region to be copied */ if (dstPrivate->attachment == DRI2BufferFrontLeft) { @@ -338,7 +339,7 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, ADVANCE_BATCH(); } - (*pGC->ops->CopyArea)(&pSrcPixmap->drawable, &pDstPixmap->drawable, + (*pGC->ops->CopyArea)(src, dst, pGC, 0, 0, pDraw->width, pDraw->height, 0, 0); FreeScratchGC(pGC); |