[beryl-commits] r1538 - trunk/beryl-plugins/src

onestone at server.beryl-project.org onestone at server.beryl-project.org
Mon Dec 4 14:47:03 CET 2006


Author: onestone
Date: 2006-12-04 14:46:20 +0100 (Mon, 04 Dec 2006)
New Revision: 1538

Modified:
   trunk/beryl-plugins/src/blurfx.c
Log:
beryl-plugins: blurfx: fixed some nonfbo issues in combination with transparent cube

Modified: trunk/beryl-plugins/src/blurfx.c
===================================================================
--- trunk/beryl-plugins/src/blurfx.c	2006-12-04 11:26:31 UTC (rev 1537)
+++ trunk/beryl-plugins/src/blurfx.c	2006-12-04 13:46:20 UTC (rev 1538)
@@ -3422,7 +3422,7 @@
 		XUnionRectWithRegion(&rect, reblurRegion, reblurRegion);
 	}
 
-	XIntersectRegion(reblurRegion, &s->outputDev[bs->output].region,
+	XIntersectRegion(reblurRegion, &s->region,
 			 reblurRegion);
 
 	XSubtractRegion(reblurRegion, bs->blurredRegion, reblurRegion);
@@ -3471,6 +3471,14 @@
 		enable_light = TRUE;
     }
 
+	Bool enable_stencil = FALSE;
+
+	if (glIsEnabled (GL_STENCIL_TEST))
+    {
+		glDisable (GL_STENCIL_TEST);
+		enable_stencil = TRUE;
+    }
+
 	int i;
 	XRectangle sRect, bRect;
 	for (i = 0; i < reblurRegion->numRects; i++) {
@@ -3528,29 +3536,29 @@
 		    tm[7] + tm[15];
 
 		// calculate a bounding box of the projected rectangle
-		bBox[0] = MIN(s->width, bbProj[0][0]);
+		bBox[0] = MIN(s->outputDev[bs->output].region.extents.x2, bbProj[0][0]);
 		bBox[0] = MIN(bBox[0], bbProj[1][0]);
 		bBox[0] = MIN(bBox[0], bbProj[2][0]);
 		bBox[0] = MIN(bBox[0], bbProj[3][0]);
-		bBox[0] = MAX(bBox[0], 0.0);
+		bBox[0] = MAX(bBox[0], s->outputDev[bs->output].region.extents.x1);
 
-		bBox[1] = MIN(s->height, bbProj[0][1]);
+		bBox[1] = MIN(s->outputDev[bs->output].region.extents.y2, bbProj[0][1]);
 		bBox[1] = MIN(bBox[1], bbProj[1][1]);
 		bBox[1] = MIN(bBox[1], bbProj[2][1]);
 		bBox[1] = MIN(bBox[1], bbProj[3][1]);
-		bBox[1] = MAX(bBox[1], 0.0);
+		bBox[1] = MAX(bBox[1], s->outputDev[bs->output].region.extents.y1);
 
-		bBox[2] = MAX(0.0, bbProj[0][0]);
+		bBox[2] = MAX(s->outputDev[bs->output].region.extents.x1, bbProj[0][0]);
 		bBox[2] = MAX(bBox[2], bbProj[1][0]);
 		bBox[2] = MAX(bBox[2], bbProj[2][0]);
 		bBox[2] = MAX(bBox[2], bbProj[3][0]);
-		bBox[2] = MIN(bBox[2], s->width);
+		bBox[2] = MIN(bBox[2], s->outputDev[bs->output].region.extents.x2);
 
-		bBox[3] = MAX(0.0, bbProj[0][1]);
+		bBox[3] = MAX(s->outputDev[bs->output].region.extents.y1, bbProj[0][1]);
 		bBox[3] = MAX(bBox[3], bbProj[1][1]);
 		bBox[3] = MAX(bBox[3], bbProj[2][1]);
 		bBox[3] = MAX(bBox[3], bbProj[3][1]);
-		bBox[3] = MIN(bBox[3], s->height);
+		bBox[3] = MIN(bBox[3], s->outputDev[bs->output].region.extents.y2);
 
 		if (bBox[2] - bBox[0] <= 0 || bBox[3] - bBox[1] <= 0)
 			continue;
@@ -3693,6 +3701,9 @@
 	if (enable_light)
 		glEnable(GL_LIGHTING);
 
+	if (enable_stencil)
+		glEnable(GL_STENCIL_TEST);
+
 	XDestroyRegion(reblurRegion);
 }
 




More information about the commits mailing list