[xserver-commit] xserver/hw/kdrive/src kaapict.c,1.5,1.6

Eric Anholt xserver-commit@pdx.freedesktop.org
Sun, 04 Jan 2004 12:51:55 -0800


Committed by: anholt

Update of /cvs/xserver/xserver/hw/kdrive/src
In directory pdx:/home/anholt/xserver/hw/kdrive/src

Modified Files:
	kaapict.c 
Log Message:
- Don't forget to UNINIT miComputeCompositeRegion's regions
- Fix a bit of whitespace nearby.


Index: kaapict.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaapict.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- kaapict.c	3 Jan 2004 21:52:14 -0000	1.5
+++ kaapict.c	4 Jan 2004 20:51:53 -0000	1.6
@@ -248,10 +248,11 @@
     if (pDst->pDrawable->type == DRAWABLE_PIXMAP)
 	kaaPixmapUseScreen ((PixmapPtr) pDst->pDrawable);
 
-    pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x,
-				 &dst_off_y);
-    if (!pDstPix)
+    pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y);
+    if (!pDstPix) {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return 0;
+    }
 
     if (pSrc->pDrawable->type == DRAWABLE_WINDOW)
 	pSrcPix = (*pSrc->pDrawable->pScreen->GetWindowPixmap)(
@@ -269,13 +270,19 @@
     pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
     if (!kaaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
 			 pSrc->format))
+    {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return -1;
+    }
     kaaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
 			pDst->format);
 
     if (!(*pKaaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffff,
 					 pixel))
+    {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return -1;
+    }
 
     nbox = REGION_NUM_RECTS(&region);
     pbox = REGION_RECTS(&region);
@@ -291,6 +298,7 @@
     (*pKaaScr->info->DoneSolid) ();
     KdMarkSync(pDst->pDrawable->pScreen);
 
+    REGION_UNINIT(pDst->pDrawable->pScreen, &region);
     return 1;
 }
 
@@ -329,16 +337,19 @@
     if (pDst->pDrawable->type == DRAWABLE_PIXMAP)
 	kaaPixmapUseScreen ((PixmapPtr) pDst->pDrawable);
     
-    pSrcPix = kaaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x,
-				     &src_off_y);
-    pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x,
-				     &dst_off_y);
-    if (!pSrcPix || !pDstPix)
+    pSrcPix = kaaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
+    pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y);
+    if (!pSrcPix || !pDstPix) {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return 0;
+    }
 
     if (!(*pKaaScr->info->PrepareBlend) (op, pSrc, pDst, pSrcPix,
 					 pDstPix))
+    {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return -1;
+    }
     
     nbox = REGION_NUM_RECTS(&region);
     pbox = REGION_RECTS(&region);
@@ -360,6 +371,7 @@
     (*pKaaScr->info->DoneBlend) ();
     KdMarkSync(pDst->pDrawable->pScreen);
 
+    REGION_UNINIT(pDst->pDrawable->pScreen, &region);
     return 1;
 }
 
@@ -408,22 +420,22 @@
     if (pDst->pDrawable->type == DRAWABLE_PIXMAP)
 	kaaPixmapUseScreen ((PixmapPtr) pDst->pDrawable);
 
-    pSrcPix = kaaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x,
-				     &src_off_y);
-    pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x,
-				     &dst_off_y);
-    if (!pSrcPix || !pDstPix)
-	return 0;
-    if (pMask) {
+    pSrcPix = kaaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
+    if (pMask)
 	pMaskPix = kaaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x,
 					  &mask_off_y);
-	if (!pMaskPix)
-	    return 0;
+    pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y);
+    if (!pSrcPix || (pMask && !pMaskPix) || !pDstPix) {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+	return 0;
     }
 
     if (!(*pKaaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix,
 					     pMaskPix, pDstPix))
+    {
+	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return -1;
+    }
 
     nbox = REGION_NUM_RECTS(&region);
     pbox = REGION_RECTS(&region);
@@ -449,6 +461,8 @@
 
     (*pKaaScr->info->DoneComposite) ();
     KdMarkSync(pDst->pDrawable->pScreen);
+
+    REGION_UNINIT(pDst->pDrawable->pScreen, &region);
     return 1;
 }