summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-04-10 01:16:31 +0200
committerDennis Kasprzyk <onestone@opencompositing.org>2008-04-10 01:16:31 +0200
commit11c6a85a8241e9354b78018e4983c7a74480cf60 (patch)
tree82bc95e5656c2d84e014d277776a1ed6df94d4bd
parent3453b6e90d50cc5d94e57a7d57e8e15ca680efa1 (diff)
download3d-11c6a85a8241e9354b78018e4983c7a74480cf60.tar.gz
3d-11c6a85a8241e9354b78018e4983c7a74480cf60.tar.bz2
More optimizations.
-rw-r--r--3d.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/3d.c b/3d.c
index 16c6004..de36890 100644
--- a/3d.c
+++ b/3d.c
@@ -431,7 +431,7 @@ tdPostPaintViewport (CompScreen *s,
if (tds->active)
{
- CompTransform sTransform = *transform;
+ CompTransform mTransform;
CompTransform screenSpace;
CompTransform screenSpaceOffset;
CompWindow *w;
@@ -440,6 +440,8 @@ tdPostPaintViewport (CompScreen *s,
float wDepth = 0.0;
float pointZ = cs->invert * cs->distance;
Bool foundFtb;
+ int offX, offY;
+ unsigned int newMask;
CompVector vPoints[3] = { { .v = { -0.5, 0.0, pointZ, 1.0 } },
{ .v = { 0.0, 0.5, pointZ, 1.0 } },
@@ -489,13 +491,11 @@ tdPostPaintViewport (CompScreen *s,
transformToScreenSpace (s, output, -sAttrib->zTranslate,
&screenSpace);
+ glPushMatrix ();
+
/* paint all windows from bottom to top */
for (w = (*walk.first) (s); w; w = (*walk.next) (w))
{
- CompTransform mTransform = sTransform;
- int offX, offY;
- unsigned int newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
-
if (w->destroyed)
continue;
@@ -505,6 +505,9 @@ tdPostPaintViewport (CompScreen *s,
continue;
}
+ mTransform = *transform;
+ newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
+
tdw = (tdWindow *) (w)->base.privates[tds->windowPrivateIndex].ptr;
if (tdw->depth != 0.0f)
@@ -516,7 +519,7 @@ tdPostPaintViewport (CompScreen *s,
if (wDepth != 0.0)
{
tds->currentScale += wDepth;
- tds->bTransform = sTransform;
+ tds->bTransform = *transform;
(*s->applyScreenTransform) (s, sAttrib, output,
&tds->bTransform);
tds->currentScale -= wDepth;
@@ -550,17 +553,17 @@ tdPostPaintViewport (CompScreen *s,
matrixMultiply (&mTransform, &mTransform, &screenSpace);
}
- glPushMatrix ();
glLoadMatrixf (mTransform.m);
(*s->paintWindow) (w, &w->paint, &mTransform, &infiniteRegion,
newMask);
- glPopMatrix ();
(*s->disableOutputClipping) (s);
}
}
+ glPopMatrix ();
+
tds->painting3D = FALSE;
tds->currentScale = tds->basicScale;
}