summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/blurfx.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-04 13:46:20 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-04 13:46:20 +0000
commite76fcbe2f05fe179e7525eb49273077fb367f934 (patch)
treea46d9e6efa226869cce084f27ad93689f882a11f /beryl-plugins/src/blurfx.c
parent0b7a4f47be070322a47a5b1a6b17c78435f92c41 (diff)
downloadmarex-dev-e76fcbe2f05fe179e7525eb49273077fb367f934.tar.gz
marex-dev-e76fcbe2f05fe179e7525eb49273077fb367f934.tar.bz2
beryl-plugins: blurfx: fixed some nonfbo issues in combination with transparent cube
git-svn-id: file:///beryl/trunk@1538 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/blurfx.c')
-rw-r--r--beryl-plugins/src/blurfx.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/beryl-plugins/src/blurfx.c b/beryl-plugins/src/blurfx.c
index cd2a5b2..b771c09 100644
--- a/beryl-plugins/src/blurfx.c
+++ b/beryl-plugins/src/blurfx.c
@@ -3422,7 +3422,7 @@ updateBlurNoFBO(CompWindow * w, CompScreen * s,
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 @@ updateBlurNoFBO(CompWindow * w, CompScreen * s,
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 @@ updateBlurNoFBO(CompWindow * w, CompScreen * s,
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 @@ updateBlurNoFBO(CompWindow * w, CompScreen * s,
if (enable_light)
glEnable(GL_LIGHTING);
+ if (enable_stencil)
+ glEnable(GL_STENCIL_TEST);
+
XDestroyRegion(reblurRegion);
}