summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-04-10 01:04:25 +0200
committerDennis Kasprzyk <onestone@opencompositing.org>2008-04-10 01:04:25 +0200
commit3453b6e90d50cc5d94e57a7d57e8e15ca680efa1 (patch)
tree56cfc991fabd41f3210c48713d66fdc6d6a91728
parentb8861feefef3dad3f06c4f62cd17322babc62e19 (diff)
download3d-3453b6e90d50cc5d94e57a7d57e8e15ca680efa1.tar.gz
3d-3453b6e90d50cc5d94e57a7d57e8e15ca680efa1.tar.bz2
Optimizations.
-rw-r--r--3d.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/3d.c b/3d.c
index f938638..16c6004 100644
--- a/3d.c
+++ b/3d.c
@@ -435,6 +435,7 @@ tdPostPaintViewport (CompScreen *s,
CompTransform screenSpace;
CompTransform screenSpaceOffset;
CompWindow *w;
+ tdWindow *tdw;
CompWalker walk;
float wDepth = 0.0;
float pointZ = cs->invert * cs->distance;
@@ -448,29 +449,33 @@ tdPostPaintViewport (CompScreen *s,
wDepth = -MIN((tdGetWidth (s)) / 30, (1.0 - tds->basicScale) /
tds->maxDepth);
- /* all BTF windows in normal order */
- for (w = s->windows; w; w = w->next)
+ if (wDepth != 0.0)
{
- TD_WINDOW (w);
+ /* all BTF windows in normal order */
+ for (w = s->windows; w; w = w->next)
+ {
+ tdw = (tdWindow *)
+ (w)->base.privates[tds->windowPrivateIndex].ptr;
- if (!tdw->is3D)
- continue;
+ if (!tdw->is3D)
+ continue;
- if (foundFtb && FALSE)
- {
- tdw->ftb = TRUE;
- continue;
- }
+ if (foundFtb && FALSE)
+ {
+ tdw->ftb = TRUE;
+ continue;
+ }
- tds->currentScale = tds->basicScale +
- (tdw->depth * ((1.0 - tds->basicScale) /
- tds->maxDepth));
+ tds->currentScale = tds->basicScale +
+ (tdw->depth * ((1.0 - tds->basicScale) /
+ tds->maxDepth));
- tdw->ftb = (*cs->checkOrientation) (s, sAttrib, transform,
- output, vPoints);
+ tdw->ftb = (*cs->checkOrientation) (s, sAttrib, transform,
+ output, vPoints);
- if (tdw->ftb)
- foundFtb = TRUE;
+ if (tdw->ftb)
+ foundFtb = TRUE;
+ }
}
tds->currentScale = tds->basicScale;
@@ -491,8 +496,6 @@ tdPostPaintViewport (CompScreen *s,
int offX, offY;
unsigned int newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
- TD_WINDOW (w);
-
if (w->destroyed)
continue;
@@ -502,6 +505,8 @@ tdPostPaintViewport (CompScreen *s,
continue;
}
+ tdw = (tdWindow *) (w)->base.privates[tds->windowPrivateIndex].ptr;
+
if (tdw->depth != 0.0f)
{
tds->currentScale = tds->basicScale +