[beryl-commits] 3D plugin: Changes to 'master' (7ae4b0ca3b2f09a523deb4fecacb464186477228)

maniac at server.beryl-project.org maniac at server.beryl-project.org
Sun Jun 24 13:55:40 CEST 2007


New commits:
commit 7ae4b0ca3b2f09a523deb4fecacb464186477228
Author: Danny Baumann <dannybaumann at web.de>
Date:   Sat Jun 23 13:10:35 2007 +0200

    Optimization.

commit aabb431ee545b900f18a5ae9550f2e181e4ba1c6
Author: Danny Baumann <dannybaumann at web.de>
Date:   Sat Jun 23 13:07:29 2007 +0200

    Added missing metadata.

commit bc923b5711473eaaa2f98be70c154982028c0eee
Author: Danny Baumann <dannybaumann at web.de>
Date:   Sat Jun 23 13:05:50 2007 +0200

    Indention fixes.


 3d.c   |   21 ++++---
 3d.xml |  183 ++++++++++++++++++++++++++++++++++------------------------------
 2 files changed, 109 insertions(+), 95 deletions(-)


Modified: fusion/plugins/3d/3d.c
===================================================================
--- fusion/plugins/3d/3d.c
+++ fusion/plugins/3d/3d.c
@@ -121,6 +121,8 @@ typedef struct _tdScreen
 
 	int currentScreenNum;
 
+	Bool active;
+
 	Bool reorderWindowPainting;
 	CompOutput *tmpOutput;
 } tdScreen;
@@ -231,9 +233,6 @@ static Bool differentResolutions(CompScreen * s)
 #define IS_IN_VIEWPORT(w, i) ( ( LEFT_VIEWPORT(w) > RIGHT_VIEWPORT(w) && !(LEFT_VIEWPORT(w) > i && i > RIGHT_VIEWPORT(w)) ) \
                                 || ( LEFT_VIEWPORT(w) <= i && i <= RIGHT_VIEWPORT(w) ) )
 
-#define DO_3D(s) ((cs->rotationState != RotationNone) && !(tdGetManualOnly(s) && \
-			     (cs->rotationState != RotationManual)))
-
 static void reorder(CompScreen * screen)
 {
 	CompWindow *firstReordered = NULL;
@@ -383,6 +382,10 @@ static void tdPreparePaintScreen(CompScreen * screen, int msSinceLastPaint)
 	TD_SCREEN(screen);
 	CUBE_SCREEN (screen);
 
+	tds->active = (cs->rotationState != RotationNone) && 
+	              !(tdGetManualOnly(s) && 
+			(cs->rotationState != RotationManual));
+
 	if (tds->currentViewportNum != screen->hsize
 		|| tds->currentScreenNum != screen->nOutputDev
 		|| tds->currentDifferentResolutions != differentResolutions(screen))
@@ -399,7 +402,7 @@ static void tdPreparePaintScreen(CompScreen * screen, int msSinceLastPaint)
 			tds->xMove = 0.0f;
 	}
 
-	if (!DO_3D(screen))
+	if (tds->active)
 	{
 		//tds->reorder = TRUE;
 
@@ -478,7 +481,7 @@ tdPaintWindow(CompWindow * w,
 	int output = (tds->tmpOutput->id == ~0) ? 0 : tds->tmpOutput->id;
 	int width = w->screen->width;
 
-	if (DO_3D(w->screen) && tds->reorderWindowPainting)
+	if (tds->active && tds->reorderWindowPainting)
 	{
 		// Window painting is done twice, once in reverse mode and one in normal.
 		// We should paint it only in the needed mode.
@@ -832,7 +835,7 @@ tdPaintTransformedOutput(CompScreen * s,
 
 	tds->tmpOutput = output;
 
-	if (DO_3D(s))
+	if (tds->active)
 	{
 		if (tdGetMipmaps(s))
 			s->display->textureFilter = GL_LINEAR_MIPMAP_LINEAR;
@@ -864,7 +867,7 @@ tdPaintOutput(CompScreen * s,
 	TD_SCREEN(s);
 	CUBE_SCREEN(s);
 
-	if (DO_3D(s) || tds->tdWindowExists)
+	if (tds->active || tds->tdWindowExists)
 	{
 		mask |= PAINT_SCREEN_TRANSFORMED_MASK |
 				PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
@@ -888,7 +891,7 @@ static void tdDonePaintScreen(CompScreen * s)
 	tdDisableCapsEvent(s, FALSE);
 	tdPaintAllViewportsEvent(s, FALSE);
 
-	if (DO_3D(s) || tds->tdWindowExists)
+	if (tds->active || tds->tdWindowExists)
 	{
 		float aim = 0.0f;
 
@@ -901,7 +904,7 @@ static void tdDonePaintScreen(CompScreen * s)
 			tdw = GET_TD_WINDOW(w, GET_TD_SCREEN(w->screen,
 									GET_TD_DISPLAY(w->screen->display)));
 
-			if (DO_3D(s))
+			if (tds->active)
 			{
 				if (cs->invert == 1)
 					aim = tdw->z - tds->maxZ;

Modified: fusion/plugins/3d/3d.xml
===================================================================
--- fusion/plugins/3d/3d.xml
+++ fusion/plugins/3d/3d.xml
@@ -1,89 +1,100 @@
 <?xml version="1.0"?>
 <compiz>
-  <plugin name="3d" useBcop="true">
-    <screen>
-      <group>
-        <short>Misc. Options</short>
-        <option name="window_match" type="match">
-          <short>Window Match</short>
-          <long>Windows that should be handled by 3D</long>
-          <default>Toolbar | Utility | Dialog | Normal | Unknown</default>
-        </option>
-        <option name="space" type="float">
-          <short>Window Space</short>
-          <long>Change the amount of space between the windows.</long>
-          <default>0.02</default>
-          <min>0.0</min>
-          <max>1.0</max>
-          <precision>0.001</precision>
-        </option>
-        <option name="speed" type="float">
-          <short>Animation Speed</short>
-          <long>Change the speed of the 3D animation</long>
-          <default>0.02</default>
-          <min>0.0</min>
-          <max>1.0</max>
-          <precision>0.001</precision>
-        </option>
-        <option name="width" type="float">
-          <short>Window Width</short>
-          <long>Window width</long>
-          <default>0.3</default>
-          <min>0.0</min>
-          <max>1.0</max>
-          <precision>0.001</precision>
-        </option>
-        <option name="mipmaps" type="bool">
-          <short>Create Mipmaps</short>
-          <long>This will create mipmaps which improve overall texture appearence, and reduce jagged edges.</long>
-          <default>false</default>
-        </option>
-        <option name="disable_culling" type="bool">
-          <short>Draw Window Backsides</short>
-          <long>Enables the drawing of the backside of windows.</long>
-          <default>true</default>
-        </option>
-        <option name="disable_caps" type="bool">
-          <short>Disable Caps for Inside Cube</short>
-          <long>Disables the drawing of the cube caps when the inside cube mode is set.</long>
-          <default>true</default>
-        </option>
-        <option name="manual_only" type="bool">
-          <short>3D Only On Mouse Rotate</short>
-          <long>Initiates the 3D display only if rotate is mouse driven. (Ex. You rotate the cube via the mouse)</long>
-          <default>true</default>
-        </option>
-      </group>
-      <group>
-        <short>Corner Bevelling</short>
-        <option name="bevel" type="int">
-          <short>Bevel Corners</short>
-          <long>Roundoff corners for consistency with rounded decorations</long>
-          <default>0</default>
-          <min>0</min>
-          <max>20</max>
-        </option>
-        <option name="bevel_topleft" type="bool">
-          <short>Bevel Top Left</short>
-          <long>Bevel top left corner</long>
-          <default>true</default>
-        </option>
-        <option name="bevel_topright" type="bool">
-          <short>Bevel Top Right</short>
-          <long>Bevel top right corner</long>
-          <default>true</default>
-        </option>
-        <option name="bevel_bottomleft" type="bool">
-          <short>Bevel Bottom Left</short>
-          <long>Bevel bottom left corner</long>
-          <default>false</default>
-        </option>
-        <option name="bevel_bottomright" type="bool">
-          <short>Bevel Bottom Right</short>
-          <long>Bevel top bottom right corner</long>
-          <default>false</default>
-        </option>
-      </group>
-    </screen>
-  </plugin>
+	<plugin name="3d" useBcop="true">
+		<short>3D Windows</short>
+		<long>Elevates windows while rotating the cube</long>
+		<category>Effects</category>
+		<deps>
+			<requirement>
+				<plugin>cube</plugin>
+			</requirement>
+			<relation type="after">
+				<plugin>cube</plugin>
+			</relation>
+		</deps>
+		<screen>
+			<group>
+				<short>Misc. Options</short>
+				<option name="window_match" type="match">
+					<short>Window Match</short>
+					<long>Windows that should be handled by 3D</long>
+					<default>Toolbar | Utility | Dialog | Normal | Unknown</default>
+				</option>
+				<option name="space" type="float">
+					<short>Window Space</short>
+					<long>Change the amount of space between the windows.</long>
+					<default>0.02</default>
+					<min>0.0</min>
+					<max>1.0</max>
+					<precision>0.001</precision>
+				</option>
+				<option name="speed" type="float">
+					<short>Animation Speed</short>
+					<long>Change the speed of the 3D animation</long>
+					<default>0.02</default>
+					<min>0.0</min>
+					<max>1.0</max>
+					<precision>0.001</precision>
+				</option>
+				<option name="width" type="float">
+					<short>Window Width</short>
+					<long>Window width</long>
+					<default>0.3</default>
+					<min>0.0</min>
+					<max>1.0</max>
+					<precision>0.001</precision>
+				</option>
+				<option name="mipmaps" type="bool">
+					<short>Create Mipmaps</short>
+					<long>This will create mipmaps which improve overall texture appearence, and reduce jagged edges.</long>
+					<default>false</default>
+				</option>
+				<option name="disable_culling" type="bool">
+					<short>Draw Window Backsides</short>
+					<long>Enables the drawing of the backside of windows.</long>
+					<default>true</default>
+				</option>
+				<option name="disable_caps" type="bool">
+					<short>Disable Caps for Inside Cube</short>
+					<long>Disables the drawing of the cube caps when the inside cube mode is set.</long>
+					<default>true</default>
+				</option>
+				<option name="manual_only" type="bool">
+					<short>3D Only On Mouse Rotate</short>
+					<long>Initiates the 3D display only if rotate is mouse driven. (Ex. You rotate the cube via the mouse)</long>
+					<default>true</default>
+				</option>
+			</group>
+			<group>
+				<short>Corner Bevelling</short>
+				<option name="bevel" type="int">
+					<short>Bevel Corners</short>
+					<long>Roundoff corners for consistency with rounded decorations</long>
+					<default>0</default>
+					<min>0</min>
+					<max>20</max>
+				</option>
+				<option name="bevel_topleft" type="bool">
+					<short>Bevel Top Left</short>
+					<long>Bevel top left corner</long>
+					<default>true</default>
+				</option>
+				<option name="bevel_topright" type="bool">
+					<short>Bevel Top Right</short>
+					<long>Bevel top right corner</long>
+					<default>true</default>
+				</option>
+				<option name="bevel_bottomleft" type="bool">
+					<short>Bevel Bottom Left</short>
+					<long>Bevel bottom left corner</long>
+					<default>false</default>
+				</option>
+				<option name="bevel_bottomright" type="bool">
+					<short>Bevel Bottom Right</short>
+					<long>Bevel top bottom right corner</long>
+					<default>false</default>
+				</option>
+			</group>
+		</screen>
+	</plugin>
 </compiz>



More information about the commits mailing list