summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/screenshot.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/screenshot.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/screenshot.c')
-rw-r--r--beryl-plugins/src/screenshot.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/beryl-plugins/src/screenshot.c b/beryl-plugins/src/screenshot.c
index e26f5b4..dcc8ad7 100644
--- a/beryl-plugins/src/screenshot.c
+++ b/beryl-plugins/src/screenshot.c
@@ -179,7 +179,8 @@ static int shotSort(const void *_a, const void *_b)
}
static void
-shotPaintOutline(CompScreen * s, const ScreenPaintAttrib * sa,
+shotPaintOutline(CompScreen * s, const ScreenPaintAttrib * sa,
+ const CompTransform * transform,
int output, Bool transformed)
{
int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
@@ -191,16 +192,21 @@ shotPaintOutline(CompScreen * s, const ScreenPaintAttrib * sa,
x2 = MAX(ss->x1, ss->x2);
y2 = MAX(ss->y1, ss->y2);
- glPushMatrix();
+ CompTransform sTransform = *transform;
if (transformed)
{
- glLoadIdentity();
- (s->applyScreenTransform) (s, sa, output);
+ (s->applyScreenTransform) (s, sa, output, &sTransform);
+ transformToScreenSpace (s, output, -sa->zTranslate, &sTransform);
}
+ else
+ transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
+
+
+
+ glPushMatrix ();
+ glLoadMatrixf (sTransform.m);
- prepareXCoords(s, output,
- transformed ? -sa->zTranslate : -DEFAULT_Z_CAMERA);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_BLEND);
@@ -227,6 +233,7 @@ shotPaintOutline(CompScreen * s, const ScreenPaintAttrib * sa,
static Bool
shotPaintScreen(CompScreen * s,
const ScreenPaintAttrib * sAttrib,
+ const CompTransform *transform,
Region region, int output, unsigned int mask)
{
Bool status;
@@ -238,14 +245,14 @@ shotPaintScreen(CompScreen * s,
ss->y = s->y;
UNWRAP(ss, s, paintScreen);
- status = (*s->paintScreen) (s, sAttrib, region, output, mask);
+ status = (*s->paintScreen) (s, sAttrib, transform, region, output, mask);
WRAP(ss, s, paintScreen, shotPaintScreen);
if (status && ss->grab && !ss->painted)
{
if (ss->grabIndex)
{
- shotPaintOutline(s, sAttrib, output, FALSE);
+ shotPaintOutline(s, sAttrib, transform, output, FALSE);
}
else
{
@@ -318,17 +325,18 @@ shotPaintScreen(CompScreen * s,
static void
shotPaintTransformedScreen(CompScreen * s, const ScreenPaintAttrib * sa,
+ const CompTransform *transform,
Region region, int output, unsigned int mask)
{
SHOT_SCREEN(s);
UNWRAP(ss, s, paintTransformedScreen);
- (*s->paintTransformedScreen) (s, sa, region, output, mask);
+ (*s->paintTransformedScreen) (s, sa, transform, region, output, mask);
WRAP(ss, s, paintTransformedScreen, shotPaintTransformedScreen);
if (ss->grab && ss->grabIndex && (ss->x == s->x) && (ss->y == s->y)) {
ss->painted = TRUE;
- shotPaintOutline(s, sa, output, TRUE);
+ shotPaintOutline(s, sa, transform, output, TRUE);
}
}