summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxsacha <xsacha@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-14 07:59:39 +0000
committerxsacha <xsacha@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-14 07:59:39 +0000
commit86923c30c40225e1405a86ab85d5ff6b5c2cadf7 (patch)
treec83cf4a7835f2e41aeaf807c6cde81eef0cc175c
parentf2e3ea54136c8e1941660bb6cfd3bab2930a4b35 (diff)
downloadmarex-dev-86923c30c40225e1405a86ab85d5ff6b5c2cadf7.tar.gz
marex-dev-86923c30c40225e1405a86ab85d5ff6b5c2cadf7.tar.bz2
beryl-plugins-unsupported: Phase out prepareXCoords and glLoadIdentity
git-svn-id: file:///beryl/trunk@4046 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins-unsupported/src/snow.c19
-rw-r--r--beryl-plugins-unsupported/src/tile.c28
2 files changed, 26 insertions, 21 deletions
diff --git a/beryl-plugins-unsupported/src/snow.c b/beryl-plugins-unsupported/src/snow.c
index ad88b63..5a7d515 100644
--- a/beryl-plugins-unsupported/src/snow.c
+++ b/beryl-plugins-unsupported/src/snow.c
@@ -158,7 +158,8 @@ typedef struct _SnowFlake
static void InitiateSnowFlake(SnowScreen * ss, SnowFlake * sf);
static void setSnowflakeTexture(SnowScreen * ss, SnowFlake * sf);
-static void beginRendering(SnowScreen * ss, CompScreen * s, int output);
+static void beginRendering(SnowScreen * ss, CompScreen * s,
+ CompTransform * transform, int output);
static void setupDisplayList(SnowScreen * ss);
static void snowThink(SnowScreen * ss, SnowFlake * sf);
@@ -306,17 +307,17 @@ static void setupDisplayList(SnowScreen * ss)
}
-static void beginRendering(SnowScreen * ss, CompScreen * s, int output)
+static void beginRendering(SnowScreen * ss, CompScreen * s,
+ CompTransform * transform, int output)
{
- glPushMatrix();
- glLoadIdentity();
+ CompTransform sTransform = *transform;
+ transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
- prepareXCoords(s, output, -DEFAULT_Z_CAMERA);
+ glPushMatrix();
+ glLoadMatrixf (sTransform.m);
if (useBlending)
- {
glEnable(GL_BLEND);
- }
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
@@ -422,7 +423,7 @@ snowPaintScreen(CompScreen * s,
WRAP(ss, s, paintScreen, snowPaintScreen);
if (onTop && ss->active)
- beginRendering(ss, s, output);
+ beginRendering(ss, s, transform, output);
return status;
}
@@ -443,7 +444,7 @@ snowPaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
// Check whether this is the Desktop Window
if (w->type & CompWindowTypeDesktopMask && ss->active && !onTop)
{
- beginRendering(ss, w->screen, outputDeviceForWindow(w));
+ beginRendering(ss, w->screen, transform, outputDeviceForWindow(w));
}
return status;
}
diff --git a/beryl-plugins-unsupported/src/tile.c b/beryl-plugins-unsupported/src/tile.c
index fa2cd8c..964ba8c 100644
--- a/beryl-plugins-unsupported/src/tile.c
+++ b/beryl-plugins-unsupported/src/tile.c
@@ -222,15 +222,18 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
if(tw->isResizing)
mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
+ CompTransform wTransform = *transform;
+
if(tw->isResizing && td->currentAnimationType != outline) // on window texture animation
{
WindowPaintAttrib sAttrib = *attrib;
FragmentAttrib fragment;
initFragmentAttrib (&fragment, &sAttrib);
+ transformToScreenSpace (s, s->currentOutputDev, -DEFAULT_Z_CAMERA, &wTransform);
+
glPushMatrix();
- glLoadIdentity();
- prepareXCoords(s, s->currentOutputDev, -DEFAULT_Z_CAMERA);
+ glLoadMatrixf(wTransform.m);
switch(td->currentAnimationType)
{
@@ -239,7 +242,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
*/
case drop:
glRotatef(100.0f/td->animationDuration*ts->msResizing - 100, 0,0,1);
- (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, &wTransform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
break;
/*
@@ -247,7 +250,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
*/
case zoom:
glTranslatef(0,0, -1 + ts->msResizing/(float)td->animationDuration);
- (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, &wTransform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
break;
/*
@@ -261,7 +264,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
if(ts->msResizing > current*ts->oneDuration) // windows that have animation finished already
{
- (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, &wTransform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
else if(ts->msResizing > (current-1)*ts->oneDuration && ts->msResizing < current*ts->oneDuration) // animation in progress
{
@@ -274,7 +277,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
else
glTranslatef(s->width - s->width * (float)thisDur/ts->oneDuration, 0, 0);
- (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, &wTransform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
break;
@@ -293,14 +296,14 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
if(ts->msResizing < 0.40f*td->animationDuration)
{
sAttrib.opacity = OPAQUE - OPAQUE*ts->msResizing/(0.40f*td->animationDuration);
- (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, &wTransform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
else if(ts->msResizing > 0.40f*td->animationDuration && !tw->resizedAlready) // resize window right after first half
setWindowFutureSize(w);
else if(ts->msResizing > 0.60f*td->animationDuration) // second half of animation, fade in
{
sAttrib.opacity = OPAQUE*(ts->msResizing - 0.60f*td->animationDuration)/(0.40f*td->animationDuration);
- (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, &wTransform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
break;
}
@@ -311,7 +314,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
else // paint window as always
{
UNWRAP(ts, s, paintWindow);
- status = (*s->paintWindow) (w, attrib, transform, region, mask);
+ status = (*s->paintWindow) (w, attrib, &wTransform, region, mask);
WRAP(ts, s, paintWindow, tilePaintWindow);
}
@@ -386,10 +389,11 @@ static Bool tilePaintScreen(CompScreen * s,
if(!td->opt[TILE_DISPLAY_OPTION_ANIMATE].value.b || !ts->isResizing || td->currentAnimationType != outline)
return status;
- glPushMatrix();
- glLoadIdentity();
+ CompTransform sTransform = *transform;
+ transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
- prepareXCoords(s, output, -DEFAULT_Z_CAMERA);
+ glPushMatrix();
+ glLoadMatrixf(sTransform.m);
glLineWidth(4.0f);