summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/blurfx.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-14 16:49:56 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-14 16:49:56 +0000
commit6049a96eb62c5063f445268bf3493a29fed89fcf (patch)
tree9f6ceb3b3a207fe3df703396f7c90d8561ea7285 /beryl-plugins/src/blurfx.c
parent820698c0553adeb6c32baa4cfdb660641cc09873 (diff)
downloadmarex-dev-6049a96eb62c5063f445268bf3493a29fed89fcf.tar.gz
marex-dev-6049a96eb62c5063f445268bf3493a29fed89fcf.tar.bz2
beryl-plugins: blurf: fixed multimonitor problems with different resolutions
git-svn-id: file:///beryl/trunk@1197 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/blurfx.c')
-rw-r--r--beryl-plugins/src/blurfx.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/beryl-plugins/src/blurfx.c b/beryl-plugins/src/blurfx.c
index 170ba34..d0ded46 100644
--- a/beryl-plugins/src/blurfx.c
+++ b/beryl-plugins/src/blurfx.c
@@ -1214,7 +1214,7 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
disableBlurfxTexture (&bs->motionTex);
glPopMatrix ();
- glViewport (s->outputDev[bs->output].region.extents.x1, s->outputDev[bs->output].region.extents.y1, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
+ glViewport (s->outputDev[bs->output].region.extents.x1, s->height - s->outputDev[bs->output].region.extents.y2, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
@@ -1246,7 +1246,7 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
mat.xy = 0.0;
mat.yy = -1.0;
mat.x0 = 0;
- mat.y0 = s->outputDev[bs->output].height;
+ mat.y0 = s->height;
stride = 4 * sizeof (GLfloat);
genGeometry (&bs->vertArray, mat, 0, &s->outputDev[bs->output].region);
@@ -1331,7 +1331,7 @@ blurfxPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
disableBlurfxTexture (&bs->motionTex);
- glViewport (s->outputDev[bs->output].region.extents.x1, s->outputDev[bs->output].region.extents.y1, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
+ glViewport (s->outputDev[bs->output].region.extents.x1, s->height - s->outputDev[bs->output].region.extents.y2, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
glPopMatrix ();
glPopAttrib ();
@@ -2135,7 +2135,7 @@ updateBlurTexture (CompWindow * w, CompScreen * s,
0, s->outputDev[bs->output].height / 2.0, 0, 0,
0, 0, 1, 0,
s->outputDev[bs->output].width / 2.0 + s->outputDev[bs->output].region.extents.x1,
- s->outputDev[bs->output].height / 2.0 + s->outputDev[bs->output].region.extents.y1, 1, 1
+ s->outputDev[bs->output].height / 2.0 + s->height - s->outputDev[bs->output].region.extents.y2, 1, 1
};
float bpm[16];
float tm[16];
@@ -2320,7 +2320,7 @@ updateBlurTexture (CompWindow * w, CompScreen * s,
glViewport (-1, -1, 2, 2);
glRasterPos2f (0, 0);
s->rasterX = s->rasterY = 0;
- glViewport (s->outputDev[bs->output].region.extents.x1, s->outputDev[bs->output].region.extents.y1, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
+ glViewport (s->outputDev[bs->output].region.extents.x1, s->height - s->outputDev[bs->output].region.extents.y2, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
glMatrixMode (GL_MODELVIEW);
glPopMatrix ();
@@ -2557,7 +2557,7 @@ updateBlur (CompWindow * w, CompScreen * s, const WindowPaintAttrib * attrib,
0, s->outputDev[bs->output].height / 2.0, 0, 0,
0, 0, 1, 0,
s->outputDev[bs->output].width / 2.0 + s->outputDev[bs->output].region.extents.x1,
- s->outputDev[bs->output].height / 2.0 + s->outputDev[bs->output].region.extents.y1, 1, 1
+ s->outputDev[bs->output].height / 2.0 + s->height - s->outputDev[bs->output].region.extents.y2, 1, 1
};
float bpm[16];
float tm[16];
@@ -3418,7 +3418,8 @@ updateBlurNoFBO (CompWindow * w, CompScreen * s,
// copy downsampled background into temporary texture
switchBlurfxTexture (&bs->blurTempTexV, &bs->blurTempTexH,
COMP_TEXTURE_FILTER_GOOD);
- glCopyTexSubImage2D (bs->blurTempTexV.target, 0, sRect.x, sRect.y,
+ glCopyTexSubImage2D (bs->blurTempTexV.target, 0, sRect.x, sRect.y +
+ ((s->height - s->outputDev[bs->output].region.extents.y2) / bs->downSample),
bRect.x, s->height - bRect.y - sRect.height,
sRect.width, sRect.height);
@@ -3539,7 +3540,7 @@ drawBlur (CompWindow * w, CompScreen * s, CompTexture * texture,
float bm[16] = { s->outputDev[bs->output].width / (2.0 * bs->downSample), 0, 0, 0, 0,
s->outputDev[bs->output].height / (2.0 * bs->downSample), 0, 0, 0, 0, 1, 0,
s->outputDev[bs->output].width / (2.0 * bs->downSample) + (s->outputDev[bs->output].region.extents.x1 / bs->downSample),
- s->outputDev[bs->output].height / (2.0 * bs->downSample) + (s->outputDev[bs->output].region.extents.y1 / bs->downSample), 1,
+ s->outputDev[bs->output].height / (2.0 * bs->downSample) + ((s->height - s->outputDev[bs->output].region.extents.y2) / bs->downSample), 1,
1
};
if (bs->downSample != 1.0)
@@ -4191,7 +4192,7 @@ bindFbo (CompScreen * s, BlurTexture tex)
glDepthRange (0, 1);
glViewport (-1, -1, 2, 2);
glRasterPos2f (0, 0);
- glViewport (s->outputDev[bs->output].region.extents.x1, s->outputDev[bs->output].region.extents.y1, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
+ glViewport (s->outputDev[bs->output].region.extents.x1, s->height - s->outputDev[bs->output].region.extents.y2, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
prepareXCoords (s, bs->output, -DEFAULT_Z_CAMERA);
@@ -4225,7 +4226,7 @@ unbindFbo (CompScreen * s)
glViewport (-1, -1, 2, 2);
glRasterPos2f (0, 0);
s->rasterX = s->rasterY = 0;
- glViewport (s->outputDev[bs->output].region.extents.x1, s->outputDev[bs->output].region.extents.y1, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
+ glViewport (s->outputDev[bs->output].region.extents.x1, s->height - s->outputDev[bs->output].region.extents.y2, s->outputDev[bs->output].width, s->outputDev[bs->output].height);
glMatrixMode (GL_PROJECTION);
glPopMatrix ();