summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-06-27 09:00:49 +0200
committerDanny Baumann <dannybaumann@web.de>2007-06-27 09:00:49 +0200
commitc37da9c976d7563d8a13a79623a00c6488cdf8b2 (patch)
treeea9852a7a0bc11ee7b71125cbe4c7fe5697928d4
parent2ed90681ac7161794927c28fd7d0285fd2718baf (diff)
download3d-c37da9c976d7563d8a13a79623a00c6488cdf8b2.tar.gz
3d-c37da9c976d7563d8a13a79623a00c6488cdf8b2.tar.bz2
Correctly disable caps painting.
-rw-r--r--3d.c75
1 files changed, 53 insertions, 22 deletions
diff --git a/3d.c b/3d.c
index 5eed4f8..8cd28a2 100644
--- a/3d.c
+++ b/3d.c
@@ -82,6 +82,9 @@ typedef struct _tdScreen
DonePaintScreenProc donePaintScreen;
InitWindowWalkerProc initWindowWalker;
+ CubePaintTopProc paintTop;
+ CubePaintBottomProc paintBottom;
+
InitPluginForScreenProc initPluginForScreen;
FiniPluginForScreenProc finiPluginForScreen;
@@ -329,24 +332,6 @@ static void tdPaintAllViewportsEvent(CompScreen* s, Bool paintAllViewports)
o, 2);
}
-static void tdDisableCapsEvent(CompScreen* s, Bool disableCaps)
-{
- CompOption o[2];
-
- o[0].type = CompOptionTypeInt;
- o[0].name = "root";
- o[0].value.i = s->root;
-
- o[1].type = CompOptionTypeBool;
- o[1].name = "disableCaps";
- o[1].value.b = disableCaps;
-
- (*s->display->handleCompizEvent) (s->display,
- "3d",
- "disableCaps",
- o, 2);
-}
-
static void tdPreparePaintScreen(CompScreen * screen, int msSinceLastPaint)
{
tdWindow **lastInViewport;
@@ -430,9 +415,6 @@ static void tdPreparePaintScreen(CompScreen * screen, int msSinceLastPaint)
tds->maxZ = tdw->z;
}
- if (tds->maxZ > 0.0f && cs->invert == -1 && tdGetDisableCaps(screen))
- tdDisableCapsEvent(screen, TRUE);
-
reorder(screen);
//tds->reorder = FALSE;
@@ -817,7 +799,6 @@ static void tdDonePaintScreen(CompScreen * s)
TD_SCREEN(s);
CUBE_SCREEN (s);
- tdDisableCapsEvent(s, FALSE);
tdPaintAllViewportsEvent(s, FALSE);
if (tds->active || tds->tdWindowExists)
@@ -862,6 +843,46 @@ static void tdDonePaintScreen(CompScreen * s)
WRAP(tds, s, donePaintScreen, tdDonePaintScreen);
}
+static void
+tdCubePaintTop (CompScreen *s,
+ const ScreenPaintAttrib *sAttrib,
+ const CompTransform *transform,
+ CompOutput *output,
+ int size)
+{
+ TD_SCREEN (s);
+ CUBE_SCREEN (s);
+
+ if (tds->maxZ > 0.0f && cs->invert == -1 && tdGetDisableCaps(s))
+ return;
+ else
+ {
+ UNWRAP (tds, cs, paintTop);
+ (*cs->paintTop) (s, sAttrib, transform, output, size);
+ WRAP (tds, cs, paintTop, tdCubePaintTop);
+ }
+}
+
+static void
+tdCubePaintBottom (CompScreen *s,
+ const ScreenPaintAttrib *sAttrib,
+ const CompTransform *transform,
+ CompOutput *output,
+ int size)
+{
+ TD_SCREEN (s);
+ CUBE_SCREEN (s);
+
+ if (tds->maxZ > 0.0f && cs->invert == -1 && tdGetDisableCaps(s))
+ return;
+ else
+ {
+ UNWRAP (tds, cs, paintBottom);
+ (*cs->paintBottom) (s, sAttrib, transform, output, size);
+ WRAP (tds, cs, paintBottom, tdCubePaintBottom);
+ }
+}
+
static CompWindow *
tdWalkFirst (CompScreen *s)
{
@@ -1002,12 +1023,17 @@ static Bool tdInitPluginForScreen (CompPlugin *p, CompScreen *s)
{
if (cubeDisplayPrivateIndex >= 0)
{
+ CUBE_SCREEN (s);
+
WRAP(tds, s, paintTransformedOutput, tdPaintTransformedOutput);
WRAP(tds, s, paintWindow, tdPaintWindow);
WRAP(tds, s, paintOutput, tdPaintOutput);
WRAP(tds, s, donePaintScreen, tdDonePaintScreen);
WRAP(tds, s, preparePaintScreen, tdPreparePaintScreen);
WRAP(tds, s, initWindowWalker, tdInitWindowWalker);
+
+ WRAP(tds, cs, paintTop, tdCubePaintTop);
+ WRAP(tds, cs, paintBottom, tdCubePaintBottom);
}
}
@@ -1024,12 +1050,17 @@ static void tdFiniPluginForScreen (CompPlugin *p, CompScreen *s)
if (strcmp(p->vTable->name, "cube") == 0)
{
+ CUBE_SCREEN (s);
+
UNWRAP(tds, s, paintTransformedOutput);
UNWRAP(tds, s, paintWindow);
UNWRAP(tds, s, paintOutput);
UNWRAP(tds, s, donePaintScreen);
UNWRAP(tds, s, preparePaintScreen);
UNWRAP(tds, s, initWindowWalker);
+
+ UNWRAP(tds, cs, paintTop);
+ UNWRAP(tds, cs, paintBottom);
}
}