summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/blurfx.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-11 00:11:12 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-11 00:11:12 +0000
commitaa60741972d71a7388346c35b4ce7d2154d952ce (patch)
treeee1b57c4e7ec1bec7695e108161083a6fc54f47a /beryl-plugins/src/blurfx.c
parentb89baa375265bed53737af9b0512cef2a9de9d8d (diff)
downloadmarex-dev-aa60741972d71a7388346c35b4ce7d2154d952ce.tar.gz
marex-dev-aa60741972d71a7388346c35b4ce7d2154d952ce.tar.bz2
xinerama updates
git-svn-id: file:///beryl/trunk@587 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/blurfx.c')
-rw-r--r--beryl-plugins/src/blurfx.c72
1 files changed, 53 insertions, 19 deletions
diff --git a/beryl-plugins/src/blurfx.c b/beryl-plugins/src/blurfx.c
index da18ee0..9148cc4 100644
--- a/beryl-plugins/src/blurfx.c
+++ b/beryl-plugins/src/blurfx.c
@@ -1012,6 +1012,8 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
bs->realPaintRegion = region;
+ bs->output = output;
+
// blur needs bigger repaint regions
for (i = 0; i < region->numRects; i++)
{
@@ -1084,7 +1086,7 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
bs->mode = MODE_NORMAL;
- Bool splash = IPCS_GetBoolND(IPCS_OBJECT (s),"SPLASH_IS_ACTIVE",FALSE);
+ Bool splash = IPCS_GetBoolND (IPCS_OBJECT (s), "SPLASH_IS_ACTIVE", FALSE);
blur_fbo &= !DISABLE_FEATURE (s, bs->ipcs_disable_blur);
blur_fbo &= !splash;
@@ -1094,6 +1096,8 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
if (!bs->motion_blur_active)
bs->mb_update = TRUE;
+ Bool enable_scissor = FALSE;
+
// store the projection matrix
glGetFloatv (GL_PROJECTION_MATRIX, bs->pm);
@@ -1119,10 +1123,16 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
unbindFbo (s);
- if (bs->motion_blur_active && bs->mb_mode == 2)
+ if (bs->motion_blur_active && bs->mb_mode == 2
+ && output + 1 == s->nOutputDev)
{
// blend actual screen into motion blur texture
+ if (glIsEnabled (GL_SCISSOR_TEST))
+ {
+ glDisable (GL_SCISSOR_TEST);
+ enable_scissor = TRUE;
+ }
glPushAttrib (GL_COLOR_BUFFER_BIT | GL_TEXTURE_BIT);
GLERR;
bindFbo (s, bs->motionTex);
@@ -1261,7 +1271,14 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
WRAP (bs, s, paintScreen, blurfxPaintScreen);
}
- if (bs->motion_blur_active && bs->mb_mode == 0)
+ if (bs->motion_blur_active && glIsEnabled (GL_SCISSOR_TEST))
+ {
+ glDisable (GL_SCISSOR_TEST);
+ enable_scissor = TRUE;
+ }
+
+ if (bs->motion_blur_active && bs->mb_mode == 0
+ && output + 1 == s->nOutputDev)
{
// blend motion blur texture to screen
@@ -1321,7 +1338,8 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
damageScreen (s);
}
- if (bs->motion_blur_active && bs->mb_mode == 1)
+ if (bs->motion_blur_active && bs->mb_mode == 1
+ && output + 1 == s->nOutputDev)
{
// create motion blur effect using accumulation buffer
@@ -1342,14 +1360,17 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
bs->mb_update = FALSE;
damageScreen (s);
}
+
+ if (enable_scissor)
+ glEnable (GL_SCISSOR_TEST);
+
XDestroyRegion (bigregion);
return status;
}
static void
blurfxPaintTransformedScreen (CompScreen * s, const ScreenPaintAttrib * sa,
- int output,
- unsigned int mask)
+ int output, unsigned int mask)
{
BLURFX_SCREEN (s);
@@ -1470,7 +1491,7 @@ blurfxPaintWindow (CompWindow * w, const WindowPaintAttrib * attrib,
value.list.value[i].s);
}
- Bool splash = IPCS_GetBoolND(IPCS_OBJECT (s),"SPLASH_IS_ACTIVE",FALSE);
+ Bool splash = IPCS_GetBoolND (IPCS_OBJECT (s), "SPLASH_IS_ACTIVE", FALSE);
blur_enabled &= !DISABLE_FEATURE (s, bs->ipcs_disable_blur);
blur_enabled &= !DISABLE_FEATURE (w, bw->ipcs_disable_blur);
@@ -1552,7 +1573,8 @@ blurfxPaintWindow (CompWindow * w, const WindowPaintAttrib * attrib,
}
if (bs->was_transformed)
- XUnionRegion (&s->region, bs->screenDamage, bs->screenDamage);
+ XUnionRegion (&s->outputDev[bs->output].region, bs->screenDamage,
+ bs->screenDamage);
if (!(mask & PAINT_WINDOW_SOLID_MASK) && !WINDOW_INPUT_INVISIBLE (w))
{
@@ -1687,7 +1709,7 @@ blurfxDrawWindowTexture (CompWindow * w, CompTexture * texture,
value.list.value[i].s);
}
- Bool splash = IPCS_GetBoolND(IPCS_OBJECT (s),"SPLASH_IS_ACTIVE",FALSE);
+ Bool splash = IPCS_GetBoolND (IPCS_OBJECT (s), "SPLASH_IS_ACTIVE", FALSE);
blur_enabled &= !DISABLE_FEATURE (s, bs->ipcs_disable_blur);
blur_enabled &= !DISABLE_FEATURE (w, bw->ipcs_disable_blur);
@@ -1756,13 +1778,20 @@ blurfxDrawWindowTexture (CompWindow * w, CompTexture * texture,
if (blur_enabled)
{
Bool enable_stencil = FALSE;
+ Bool enable_scissor = FALSE;
if (useFbo)
{
- if (glIsEnabled( GL_STENCIL_TEST))
+ if (glIsEnabled (GL_STENCIL_TEST))
{
- glDisable(GL_STENCIL_TEST);
+ glDisable (GL_STENCIL_TEST);
enable_stencil = TRUE;
}
+ if (glIsEnabled (GL_SCISSOR_TEST))
+ {
+ glDisable (GL_SCISSOR_TEST);
+ enable_scissor = TRUE;
+ }
+
s->framebufferRenderbuffer (GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, 0);
@@ -1806,7 +1835,9 @@ blurfxDrawWindowTexture (CompWindow * w, CompTexture * texture,
GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, bs->rb);
if (enable_stencil)
- glEnable( GL_STENCIL_TEST);
+ glEnable (GL_STENCIL_TEST);
+ if (enable_scissor)
+ glEnable (GL_SCISSOR_TEST);
}
else
{
@@ -2067,7 +2098,8 @@ updateBlurTexture (CompWindow * w, CompScreen * s,
XIntersectRegion (reblurRegion, bw->texDamage, reblurRegion);
XIntersectRegion (reblurRegion, bw->bTexRegion, reblurRegion);
- XIntersectRegion (reblurRegion, &s->region, reblurRegion);
+ XIntersectRegion (reblurRegion, &s->outputDev[bs->output].region,
+ reblurRegion);
// subtract occluded region
if (bs->od_active)
@@ -2460,7 +2492,8 @@ updateBlur (CompWindow * w, CompScreen * s, const WindowPaintAttrib * attrib,
XUnionRectWithRegion (&rect, reblurRegion, reblurRegion);
}
- XIntersectRegion (reblurRegion, &s->region, reblurRegion);
+ XIntersectRegion (reblurRegion, &s->outputDev[bs->output].region,
+ reblurRegion);
XSubtractRegion (reblurRegion, bs->blurredRegion, reblurRegion);
@@ -2839,7 +2872,8 @@ updateBlurTextureNoFBO (CompWindow * w, CompScreen * s,
XIntersectRegion (reblurRegion, bw->texDamage, reblurRegion);
XIntersectRegion (reblurRegion, bw->bTexRegion, reblurRegion);
- XIntersectRegion (reblurRegion, &s->region, reblurRegion);
+ XIntersectRegion (reblurRegion, &s->outputDev[bs->output].region,
+ reblurRegion);
// subtract occluded region
if (bs->od_active)
@@ -3141,7 +3175,8 @@ updateBlurNoFBO (CompWindow * w, CompScreen * s,
XUnionRectWithRegion (&rect, reblurRegion, reblurRegion);
}
- XIntersectRegion (reblurRegion, &s->region, reblurRegion);
+ XIntersectRegion (reblurRegion, &s->outputDev[bs->output].region,
+ reblurRegion);
XSubtractRegion (reblurRegion, bs->blurredRegion, reblurRegion);
@@ -4423,9 +4458,8 @@ loadPngToTexture2D (BlurfxScreen * bs, BlurTexture * tex, char *filename)
GLERR;
if (stat (filename, &fInfo) ||
- !S_ISREG (fInfo.st_mode) ||
- S_ISDIR (fInfo.st_mode) ||
- access (filename, F_OK) != 0)
+ !S_ISREG (fInfo.st_mode) ||
+ S_ISDIR (fInfo.st_mode) || access (filename, F_OK) != 0)
{
fprintf (stderr, "Unable to read image \"%s\" \n", filename);
return;