summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/inputzoom.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 00:43:33 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 00:43:33 +0000
commit0ab00e046951ad9b6263c8fb0ede3effa86d222d (patch)
treeaf3675da1e41d63d136e72824326d2a0c358bb7b /beryl-plugins/src/inputzoom.c
parent104ed8ebe6ebeed3e48c8b1269a23e36928aacc8 (diff)
downloadmarex-dev-0ab00e046951ad9b6263c8fb0ede3effa86d222d.tar.gz
marex-dev-0ab00e046951ad9b6263c8fb0ede3effa86d222d.tar.bz2
beryl-(core|plugins): moved matrix transformations out of gl (David Reveman)
- group not ported yet - blurfx has bugs but this will be fixed in a rewrite all other plugins should work git-svn-id: file:///beryl/trunk@4005 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/inputzoom.c')
-rw-r--r--beryl-plugins/src/inputzoom.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/beryl-plugins/src/inputzoom.c b/beryl-plugins/src/inputzoom.c
index 4407396..3c65d8d 100644
--- a/beryl-plugins/src/inputzoom.c
+++ b/beryl-plugins/src/inputzoom.c
@@ -480,12 +480,13 @@ static int adjustZoomVelocity(ZoomScreen * zs)
static void
zoomApplyScreenTransform(CompScreen * s,
- const ScreenPaintAttrib * sAttrib, int output)
+ const ScreenPaintAttrib * sAttrib, int output,
+ CompTransform *transform)
{
ZOOM_SCREEN(s);
UNWRAP(zs, s, applyScreenTransform);
- (*s->applyScreenTransform) (s, sAttrib, output);
+ (*s->applyScreenTransform) (s, sAttrib, output, transform);
WRAP(zs, s, applyScreenTransform, zoomApplyScreenTransform);
Bool *pCaps = (Bool *) IPCS_GetVPtrND(IPCS_OBJECT(s),
@@ -521,8 +522,8 @@ zoomApplyScreenTransform(CompScreen * s,
ty /= oh;
ty = ty * (zs->yscale - 1);
- glTranslatef(tx, ty, 0.0f);
- glScalef(zs->xscale, zs->yscale, 1.0f);
+ matrixTranslate(transform, tx, ty, 0.0f);
+ matrixScale(transform, zs->xscale, zs->yscale, 1.0f);
}
}
@@ -665,6 +666,7 @@ static void zoomDonePaintScreen(CompScreen * s)
static Bool
zoomPaintScreen(CompScreen * s,
const ScreenPaintAttrib * sAttrib,
+ const CompTransform *transform,
Region region, int output, unsigned int mask)
{
Bool status;
@@ -685,7 +687,7 @@ zoomPaintScreen(CompScreen * s,
s->filter[SCREEN_TRANS_FILTER] = COMP_TEXTURE_FILTER_FAST;
UNWRAP(zs, s, paintScreen);
- status = (*s->paintScreen) (s, sAttrib, region, output, mask);
+ status = (*s->paintScreen) (s, sAttrib, transform, region, output, mask);
WRAP(zs, s, paintScreen, zoomPaintScreen);
s->filter[SCREEN_TRANS_FILTER] = saveFilter;
@@ -693,7 +695,7 @@ zoomPaintScreen(CompScreen * s,
else
{
UNWRAP(zs, s, paintScreen);
- status = (*s->paintScreen) (s, sAttrib, region, output, mask);
+ status = (*s->paintScreen) (s, sAttrib, transform, region, output, mask);
WRAP(zs, s, paintScreen, zoomPaintScreen);
}
@@ -702,6 +704,7 @@ zoomPaintScreen(CompScreen * s,
static void
zoomPaintTransformedScreen(CompScreen * s, const ScreenPaintAttrib * sa,
+ const CompTransform *transform,
Region region, int output, unsigned int mask)
{
ZOOM_SCREEN(s);
@@ -739,15 +742,17 @@ zoomPaintTransformedScreen(CompScreen * s, const ScreenPaintAttrib * sa,
r.extents.y2 = MIN(s->height, r.extents.y2);
UNWRAP(zs, s, paintTransformedScreen);
- (*s->paintTransformedScreen) (s, sa, &r, output, mask);
+ (*s->paintTransformedScreen) (s, sa, transform, &r, output, mask);
WRAP(zs, s, paintTransformedScreen, zoomPaintTransformedScreen);
if (zs->cursor.isSet)
{
- glPushMatrix();
- glLoadIdentity();
- prepareXCoords(s, output, -DEFAULT_Z_CAMERA);
+ CompTransform sTransform = *transform;
+ transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
+
+ glPushMatrix ();
+ glLoadMatrixf (sTransform.m);
glTranslatef(zs->mouseX, zs->mouseY, 0.0);
glScalef(zs->xscale, zs->yscale, 1.0f);
int x = -zs->cursor.hotX;
@@ -778,7 +783,7 @@ zoomPaintTransformedScreen(CompScreen * s, const ScreenPaintAttrib * sa,
else
{
UNWRAP(zs, s, paintTransformedScreen);
- (*s->paintTransformedScreen) (s, sa, region, output, mask);
+ (*s->paintTransformedScreen) (s, sa, transform, region, output, mask);
WRAP(zs, s, paintTransformedScreen, zoomPaintTransformedScreen);
}
}