diff -Nru compiz-plugins-main-0.9.7.0~bzr19/debian/changelog compiz-plugins-main-0.9.7.0~bzr19/debian/changelog --- compiz-plugins-main-0.9.7.0~bzr19/debian/changelog 2012-04-03 13:45:50.000000000 +0000 +++ compiz-plugins-main-0.9.7.0~bzr19/debian/changelog 2012-04-06 12:44:41.000000000 +0000 @@ -1,3 +1,17 @@ +compiz-plugins-main (1:0.9.7.0~bzr19-0ubuntu9) precise; urgency=low + + * add quilt support to debian/rules + * enable per-arch patches in debian/rules (series. is now respected) + * add arch specific .install files for armel/armhf + * enable gles2 buildoptions on armel/armhf + * add arch specific compiz-plugins-main-gles2.patch for arm arches, credits + go to Alexandros Frantzis for creating + it. + * build depend on compiz-dev 1:0.9.7.4-0ubuntu3 since we need the + FindOpenGLES2.cmake fix from this version to build on armhf(/el) + + -- Oliver Grawert Fri, 06 Apr 2012 02:50:50 +0200 + compiz-plugins-main (1:0.9.7.0~bzr19-0ubuntu8) precise; urgency=low [ Matthias Niess] diff -Nru compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armel compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armel --- compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armel 1970-01-01 00:00:00.000000000 +0000 +++ compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armel 2012-04-06 00:48:56.000000000 +0000 @@ -0,0 +1,24 @@ +debian/tmp/usr/*/compiz/*imgjpeg.* +debian/tmp/usr/share/gconf/schemas/*imgjpeg.* +debian/tmp/usr/*/compiz/*kdecompat.* +debian/tmp/usr/share/gconf/schemas/*kdecompat.* +debian/tmp/usr/*/compiz/*neg.* +debian/tmp/usr/share/gconf/schemas/*neg.* +debian/tmp/usr/*/compiz/*opacify.* +debian/tmp/usr/share/gconf/schemas/*opacify.* +debian/tmp/usr/*/compiz/*put.* +debian/tmp/usr/share/gconf/schemas/*put.* +debian/tmp/usr/*/compiz/*resizeinfo.* +debian/tmp/usr/share/gconf/schemas/*resizeinfo.* +debian/tmp/usr/*/compiz/*ring.* +debian/tmp/usr/share/gconf/schemas/*ring.* +debian/tmp/usr/*/compiz/*scaleaddon.* +debian/tmp/usr/share/gconf/schemas/*scaleaddon.* +debian/tmp/usr/*/compiz/*shift.* +debian/tmp/usr/share/gconf/schemas/*shift.* +debian/tmp/usr/*/compiz/*text.* +debian/tmp/usr/share/gconf/schemas/*text.* +debian/tmp/usr/*/compiz/*thumbnail.* +debian/tmp/usr/share/gconf/schemas/*thumbnail.* +debian/tmp/usr/*/compiz/*winrules.* +debian/tmp/usr/share/gconf/schemas/*winrules.* diff -Nru compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armhf compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armhf --- compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armhf 1970-01-01 00:00:00.000000000 +0000 +++ compiz-plugins-main-0.9.7.0~bzr19/debian/compiz-plugins-main.install.armhf 2012-04-06 00:48:56.000000000 +0000 @@ -0,0 +1,24 @@ +debian/tmp/usr/*/compiz/*imgjpeg.* +debian/tmp/usr/share/gconf/schemas/*imgjpeg.* +debian/tmp/usr/*/compiz/*kdecompat.* +debian/tmp/usr/share/gconf/schemas/*kdecompat.* +debian/tmp/usr/*/compiz/*neg.* +debian/tmp/usr/share/gconf/schemas/*neg.* +debian/tmp/usr/*/compiz/*opacify.* +debian/tmp/usr/share/gconf/schemas/*opacify.* +debian/tmp/usr/*/compiz/*put.* +debian/tmp/usr/share/gconf/schemas/*put.* +debian/tmp/usr/*/compiz/*resizeinfo.* +debian/tmp/usr/share/gconf/schemas/*resizeinfo.* +debian/tmp/usr/*/compiz/*ring.* +debian/tmp/usr/share/gconf/schemas/*ring.* +debian/tmp/usr/*/compiz/*scaleaddon.* +debian/tmp/usr/share/gconf/schemas/*scaleaddon.* +debian/tmp/usr/*/compiz/*shift.* +debian/tmp/usr/share/gconf/schemas/*shift.* +debian/tmp/usr/*/compiz/*text.* +debian/tmp/usr/share/gconf/schemas/*text.* +debian/tmp/usr/*/compiz/*thumbnail.* +debian/tmp/usr/share/gconf/schemas/*thumbnail.* +debian/tmp/usr/*/compiz/*winrules.* +debian/tmp/usr/share/gconf/schemas/*winrules.* diff -Nru compiz-plugins-main-0.9.7.0~bzr19/debian/control compiz-plugins-main-0.9.7.0~bzr19/debian/control --- compiz-plugins-main-0.9.7.0~bzr19/debian/control 2012-04-03 13:45:50.000000000 +0000 +++ compiz-plugins-main-0.9.7.0~bzr19/debian/control 2012-04-06 12:42:35.000000000 +0000 @@ -7,11 +7,11 @@ cmake, quilt, intltool, - compiz-dev (>= 1:0.9.7.2), + compiz-dev (>= 1:0.9.7.4-0ubuntu3), libgconf2-dev, libglib2.0-dev, libtool, - libglu1-mesa-dev, + libglu1-mesa-dev [!armel !armhf], libjpeg-dev, libxml2-dev, libxslt1-dev, diff -Nru compiz-plugins-main-0.9.7.0~bzr19/debian/patches/compiz-plugins-main-gles2.patch compiz-plugins-main-0.9.7.0~bzr19/debian/patches/compiz-plugins-main-gles2.patch --- compiz-plugins-main-0.9.7.0~bzr19/debian/patches/compiz-plugins-main-gles2.patch 1970-01-01 00:00:00.000000000 +0000 +++ compiz-plugins-main-0.9.7.0~bzr19/debian/patches/compiz-plugins-main-gles2.patch 2012-04-06 00:57:52.000000000 +0000 @@ -0,0 +1,5173 @@ +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/animation.xml.in compiz-plugins-main-gles2/animation/animation.xml.in +--- compiz-plugins-main-package/animation/animation.xml.in 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/animation.xml.in 2012-04-05 12:29:41.374453000 +0200 +@@ -124,7 +124,7 @@ + match + + ((type=Normal | Unknown) | name=sun-awt-X11-XFramePeer | name=sun-awt-X11-XDialogPeer) & !(role=toolTipTip | role=qtooltip_label) & !(type=Normal & override_redirect=1) & !(name=gnome-screensaver) & !(name=gnome-screenshot) +- (type=Menu | PopupMenu | DropdownMenu | Combo | Dialog | ModalDialog | Normal) ++ (type=Menu | PopupMenu | DropdownMenu | Combo | Dialog | ModalDialog | Normal) + (type=Tooltip | Notification | Utility) & !(name=compiz) & !(title=notify-osd) + + +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/CMakeLists.txt compiz-plugins-main-gles2/animation/CMakeLists.txt +--- compiz-plugins-main-package/animation/CMakeLists.txt 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/CMakeLists.txt 2012-04-05 12:29:41.374453000 +0200 +@@ -1,7 +1,5 @@ + find_package (Compiz REQUIRED) + include (CompizPlugin) +-include (FindOpenGL) + +-if (OPENGL_GLU_FOUND) +- compiz_plugin (animation PLUGINDEPS composite opengl LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR}) +-endif (OPENGL_GLU_FOUND) ++compiz_plugin (animation PLUGINDEPS composite opengl) ++ +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/include/animation/animation.h compiz-plugins-main-gles2/animation/include/animation/animation.h +--- compiz-plugins-main-package/animation/include/animation/animation.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/include/animation/animation.h 2012-04-05 12:29:41.374453000 +0200 +@@ -3,8 +3,8 @@ + + #define ANIMATION_ABI 20091205 + ++#include + #include +-#include + + typedef enum + { +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/include/animation/animeffect.h compiz-plugins-main-gles2/animation/include/animation/animeffect.h +--- compiz-plugins-main-package/animation/include/animation/animeffect.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/include/animation/animeffect.h 2012-04-05 12:29:41.374453000 +0200 +@@ -72,7 +72,7 @@ + + int mOverrideProgressDir; ///< 0: default dir, 1: forward, 2: backward + +- GLFragment::Attrib mCurPaintAttrib; ++ GLWindowPaintAttrib mCurPaintAttrib; + GLushort mStoredOpacity; + WindowEvent mCurWindowEvent; + bool mInitialized; ///< whether the animation is initialized (in preparePaint) +@@ -160,7 +160,6 @@ + const CompRegion &clip, + unsigned int maxGridWidth, + unsigned int maxGridHeight); +- virtual void drawGeometry (); + + virtual bool paintWindowUsed () { return false; } + virtual bool paintWindow (GLWindow *gWindow, +@@ -176,9 +175,10 @@ + /// Should be overriden by a base animation class in every extension plugin. + virtual ExtensionPluginInfo *getExtensionPluginInfo (); + +- void drawTexture (GLTexture *texture, +- GLFragment::Attrib &attrib, +- unsigned int mask); ++ void drawTexture (GLTexture *texture, ++ const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, ++ unsigned int mask); + + // Utility methods + +@@ -203,7 +203,7 @@ + GLMatrix &transform); + void setInitialized () { mInitialized = true; } + inline bool initialized () { return mInitialized; } +- inline void setCurPaintAttrib (GLFragment::Attrib &newAttrib) ++ inline void setCurPaintAttrib (const GLWindowPaintAttrib &newAttrib) + { mCurPaintAttrib = newAttrib; } + }; + #endif +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/include/animation/grid.h compiz-plugins-main-gles2/animation/include/animation/grid.h +--- compiz-plugins-main-package/animation/include/animation/grid.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/include/animation/grid.h 2012-04-05 12:29:41.374453000 +0200 +@@ -78,8 +78,6 @@ + /// ( http://www.r3.nu/~cass/qcoord/ ) + bool mUseQTexCoord; + +- GLWindow::Geometry mGeometry; ///< geometry for grid mesh +- + virtual bool using3D () { return false; } + + virtual void initGrid (); ///< Initializes grid width/height. +@@ -101,6 +99,5 @@ + const CompRegion &clip, + unsigned int maxGridWidth, + unsigned int maxGridHeight); +- void drawGeometry (); + }; + #endif +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/include/animation/multi.h compiz-plugins-main-gles2/animation/include/animation/multi.h +--- compiz-plugins-main-package/animation/include/animation/multi.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/include/animation/multi.h 2012-04-05 12:29:41.374453000 +0200 +@@ -340,12 +340,6 @@ + (matrix, region, clip, maxGridWidth, maxGridHeight); + } + +- void drawGeometry () +- { +- setCurrAnimNumber (mAWindow, currentAnim); +- animList.at (currentAnim)->drawGeometry (); +- } +- + bool paintWindowUsed () + { + int count = 0; +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/src/animation.cpp compiz-plugins-main-gles2/animation/src/animation.cpp +--- compiz-plugins-main-package/animation/src/animation.cpp 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/src/animation.cpp 2012-04-05 12:29:41.374453000 +0200 +@@ -26,6 +26,10 @@ + * Particle system added by : (C) 2006 Dennis Kasprzyk + * E-mail : onestone@beryl-project.org + * ++ * Ported to GLES by : Travis Watkins ++ * (C) 2011 Linaro Limited ++ * E-mail : travis.watkins@linaro.org ++ * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 +@@ -80,8 +84,9 @@ + * + */ + +-#include + #include ++#include ++#include + #include + #include + #include "private.h" +@@ -802,6 +807,58 @@ + coordsTransformed[GLVector::y]); + } + ++static bool ++project (float objx, float objy, float objz, ++ GLMatrix modelview, GLMatrix projection, ++ const GLint viewport[4], ++ float *winx, float *winy, float *winz) ++{ ++ unsigned int i; ++ float in[4]; ++ float out[4]; ++ ++ in[0] = objx; ++ in[1] = objy; ++ in[2] = objz; ++ in[3] = 1.0; ++ ++ for (i = 0; i < 4; i++) { ++ out[i] = ++ in[0] * modelview[i] + ++ in[1] * modelview[4 + i] + ++ in[2] * modelview[8 + i] + ++ in[3] * modelview[12 + i]; ++ } ++ ++ for (i = 0; i < 4; i++) { ++ in[i] = ++ out[0] * projection[i] + ++ out[1] * projection[4 + i] + ++ out[2] * projection[8 + i] + ++ out[3] * projection[12 + i]; ++ } ++ ++ if (in[3] == 0.0) ++ return false; ++ ++ in[0] /= in[3]; ++ in[1] /= in[3]; ++ in[2] /= in[3]; ++ /* Map x, y and z to range 0-1 */ ++ in[0] = in[0] * 0.5 + 0.5; ++ in[1] = in[1] * 0.5 + 0.5; ++ in[2] = in[2] * 0.5 + 0.5; ++ ++ /* Map x,y to viewport */ ++ in[0] = in[0] * viewport[2] + viewport[0]; ++ in[1] = in[1] * viewport[3] + viewport[1]; ++ ++ *winx = in[0]; ++ *winy = in[1]; ++ *winz = in[2]; ++ return true; ++} ++ + /// Either points or objects should be non-0. + bool + AnimWindow::expandBBWithPoints3DTransform (CompOutput &output, +@@ -810,14 +867,7 @@ + GridAnim::GridModel::GridObject *objects, + unsigned int nPoints) + { +- GLdouble dModel[16]; +- GLdouble dProjection[16]; +- GLdouble x, y, z; +- for (unsigned int i = 0; i < 16; i++) +- { +- dModel[i] = transform[i]; +- dProjection[i] = GLScreen::get (::screen)->projectionMatrix ()[i]; +- } ++ GLfloat x, y, z; + GLint viewport[4] = + {output.region ()->extents.x1, + output.region ()->extents.y1, +@@ -828,9 +878,11 @@ + { + for (; nPoints; nPoints--, points += 3) + { +- if (!gluProject (points[0], points[1], points[2], +- dModel, dProjection, viewport, +- &x, &y, &z)) ++ if (!project (points[0], points[1], points[2], ++ transform, ++ *GLScreen::get (::screen)->projectionMatrix (), ++ viewport, ++ &x, &y, &z)) + return false; + + expandBBWithPoint (x + 0.5, (::screen->height () - y) + 0.5); +@@ -841,11 +893,13 @@ + GridAnim::GridModel::GridObject *object = objects; + for (; nPoints; nPoints--, object++) + { +- if (!gluProject (object->position ().x (), +- object->position ().y (), +- object->position ().z (), +- dModel, dProjection, viewport, +- &x, &y, &z)) ++ if (!project (object->position ().x (), ++ object->position ().y (), ++ object->position ().z (), ++ transform, ++ *GLScreen::get (::screen)->projectionMatrix (), ++ viewport, ++ &x, &y, &z)) + return false; + + expandBBWithPoint (x + 0.5, (::screen->height () - y) + 0.5); +@@ -1435,7 +1489,6 @@ + { + gWindow->glPaintSetEnabled (this, enabling); + gWindow->glAddGeometrySetEnabled (this, enabling); +- gWindow->glDrawGeometrySetEnabled (this, enabling); + gWindow->glDrawTextureSetEnabled (this, enabling); + } + +@@ -1508,46 +1561,28 @@ + } + + void +-PrivateAnimWindow::glDrawTexture (GLTexture *texture, +- GLFragment::Attrib &attrib, +- unsigned int mask) ++PrivateAnimWindow::glDrawTexture (GLTexture *texture, ++ const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, ++ unsigned int mask) + { + if (mCurAnimation) + { + mCurAnimation->setCurPaintAttrib (attrib); + } + +- gWindow->glDrawTexture (texture, attrib, mask); ++ gWindow->glDrawTexture (texture, transform, attrib, mask); + } + + void +-PrivateAnimWindow::glDrawGeometry () +-{ +- if (mCurAnimation) +- { +- if (mCurAnimation->initialized ()) +- mCurAnimation->drawGeometry (); +- } +- else +- { +- gWindow->glDrawGeometry (); +- } +-} +- +-void +-Animation::drawTexture (GLTexture *texture, +- GLFragment::Attrib &attrib, +- unsigned int mask) ++Animation::drawTexture (GLTexture *texture, ++ const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, ++ unsigned int mask) + { + mCurPaintAttrib = attrib; + } + +-void +-Animation::drawGeometry () +-{ +- mAWindow->priv->gWindow->glDrawGeometry (); +-} +- + bool + PrivateAnimWindow::glPaint (const GLWindowPaintAttrib &attrib, + const GLMatrix &transform, +@@ -1614,13 +1649,7 @@ + + if (mCurAnimation->postPaintWindowUsed ()) + { +- // Transform to make post-paint coincide with the window +- glPushMatrix (); +- glLoadMatrixf (wTransform.getMatrix ()); +- + mCurAnimation->postPaintWindow (); +- +- glPopMatrix (); + } + + return status; +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/src/grid.cpp compiz-plugins-main-gles2/animation/src/grid.cpp +--- compiz-plugins-main-package/animation/src/grid.cpp 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/src/grid.cpp 2012-04-05 12:29:41.374453000 +0200 +@@ -19,6 +19,10 @@ + * Hexagon tessellator added by : Mike Slegeir + * E-mail : mikeslegeir@mail.utexas.edu> + * ++ * Ported to GLES by : Travis Watkins ++ * (C) 2011 Linaro Limited ++ * E-mail : travis.watkins@linaro.org ++ * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 +@@ -36,6 +40,17 @@ + + #include "private.h" + ++// use the old structure then copy the data we want out of it ++struct GridGeometry { ++ GLfloat *vertices; ++ int vertexSize; ++ int vertexStride; ++ int vCount; ++ int texUnits; ++ int texCoordSize; ++}; ++ ++ + // ===================== Effect: Dodge ========================= + + GridAnim::GridModel::GridObject::GridObject () : +@@ -217,9 +232,9 @@ + unsigned int maxGridWidth, + unsigned int maxGridHeight) + { ++ GridGeometry geometry; + unsigned int nMatrix = matrix.size (); +- int nVertices, nIndices; +- GLushort *i; ++ int nVertices; + GLfloat *v; + int x1, y1, x2, y2; + float winContentsY, winContentsHeight; +@@ -234,8 +249,6 @@ + if (region.isEmpty ()) // nothing to do + return; + +- GLWindow::Geometry &geometry = GLWindow::get (mWindow)->geometry (); +- + for (unsigned int it = 0; it < nMatrix; it++) + { + if (matrix[it].xy != 0.0f || matrix[it].yx != 0.0f) +@@ -263,21 +276,14 @@ + winContentsHeight = oheight - outExtents.top - outExtents.bottom; + + geometry.texUnits = (int)nMatrix; +- +- if (geometry.vCount == 0) +- { +- // reset +- geometry.indexCount = 0; +- geometry.texCoordSize = 4; +- } ++ geometry.vertices = NULL; ++ geometry.vCount = 0; ++ geometry.texCoordSize = 4; + geometry.vertexStride = 3 + geometry.texUnits * geometry.texCoordSize; +- vSize = geometry.vertexStride; + ++ vSize = geometry.vertexStride; + nVertices = geometry.vCount; +- nIndices = geometry.indexCount; +- + v = geometry.vertices + (nVertices * vSize); +- i = geometry.indices + nIndices; + + // For each clip passed to this function + foreach (const CompRect &pClip, region.rects ()) +@@ -315,38 +321,22 @@ + nVertX = ceil ((x2 - x1) / gridW) + 2; + nVertY = (gridH ? ceil ((y2 - y1) / gridH) : 0) + 2; + +- // Allocate 4 indices for each quad +- int newIndexSize = nIndices + ((nVertX - 1) * (nVertY - 1) * 4); +- +- if (newIndexSize > geometry.indexSize) +- { +- if (!geometry.moreIndices (newIndexSize)) +- return; +- +- i = geometry.indices + nIndices; +- } +- // Assign quad vertices to indices +- for (int jy = 0; jy < nVertY - 1; jy++) +- { +- for (int jx = 0; jx < nVertX - 1; jx++) +- { +- *i++ = nVertices + nVertX * (2 * jy + 1) + jx; +- *i++ = nVertices + nVertX * (2 * jy + 1) + jx + 1; +- *i++ = nVertices + nVertX * 2 * jy + jx + 1; +- *i++ = nVertices + nVertX * 2 * jy + jx; +- +- nIndices += 4; +- } +- } +- + // Allocate vertices + int newVertexSize = + (nVertices + nVertX * (2 * nVertY - 2)) * vSize; +- if (newVertexSize > geometry.vertexSize) ++ if (newVertexSize > geometry.vertexSize || geometry.vertices == NULL) + { +- if (!geometry.moreVertices (newVertexSize)) ++ if (geometry.vertices == NULL) ++ geometry.vertices = (GLfloat *) ++ malloc (sizeof (GLfloat) * newVertexSize); ++ else ++ geometry.vertices = (GLfloat *) ++ realloc (geometry.vertices, sizeof (GLfloat) * newVertexSize); ++ ++ if (!geometry.vertices) + return; + ++ geometry.vertexSize = newVertexSize; + v = geometry.vertices + (nVertices * vSize); + } + +@@ -588,52 +578,8 @@ + } + } + } +- geometry.vCount = nVertices; +- geometry.indexCount = nIndices; +-} +- +-void +-GridAnim::drawGeometry () +-{ +- GLWindow::Geometry &geometry = GLWindow::get (mWindow)->geometry (); + +- int texUnit = geometry.texUnits; +- int currentTexUnit = 0; +- int stride = geometry.vertexStride; +- GLfloat *vertices = geometry.vertices + (stride - 3); +- +- stride *= (int) sizeof (GLfloat); +- +- glVertexPointer (3, GL_FLOAT, stride, vertices); +- +- while (texUnit--) +- { +- if (texUnit != currentTexUnit) +- { +- (*GL::clientActiveTexture) ((GLenum)(GL_TEXTURE0_ARB + texUnit)); +- glEnableClientState (GL_TEXTURE_COORD_ARRAY); +- currentTexUnit = texUnit; +- } +- vertices -= geometry.texCoordSize; +- glTexCoordPointer (geometry.texCoordSize, +- GL_FLOAT, stride, vertices); +- } +- +- glDrawElements (GL_QUADS, geometry.indexCount, +- GL_UNSIGNED_SHORT, geometry.indices); +- +- // disable all texture coordinate arrays except 0 +- texUnit = geometry.texUnits; +- if (texUnit > 1) +- { +- while (--texUnit) +- { +- (*GL::clientActiveTexture) ((GLenum)(GL_TEXTURE0_ARB + texUnit)); +- glDisableClientState (GL_TEXTURE_COORD_ARRAY); +- } +- +- (*GL::clientActiveTexture) (GL_TEXTURE0_ARB); +- } ++ geometry.vCount = nVertices; + } + + GridTransformAnim::GridTransformAnim (CompWindow *w, +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/animation/src/private.h compiz-plugins-main-gles2/animation/src/private.h +--- compiz-plugins-main-package/animation/src/private.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/animation/src/private.h 2012-04-05 12:29:41.374453000 +0200 +@@ -407,9 +407,8 @@ + void glAddGeometry (const GLTexture::MatrixList &, + const CompRegion &, const CompRegion &, + unsigned int = MAXSHORT, unsigned int = MAXSHORT); +- void glDrawTexture (GLTexture *texture, GLFragment::Attrib &, +- unsigned int); +- void glDrawGeometry (); ++ void glDrawTexture (GLTexture *texture, const GLMatrix &, ++ const GLWindowPaintAttrib &, unsigned int); + }; + + class RollUpAnim : +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/colorfilter/CMakeLists.txt compiz-plugins-main-gles2/colorfilter/CMakeLists.txt +--- compiz-plugins-main-package/colorfilter/CMakeLists.txt 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/colorfilter/CMakeLists.txt 2012-04-05 12:29:41.374453000 +0200 +@@ -2,4 +2,4 @@ + + include (CompizPlugin) + +-compiz_plugin (colorfilter PLUGINDEPS composite opengl) ++#compiz_plugin (colorfilter PLUGINDEPS composite opengl) +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/expo/CMakeLists.txt compiz-plugins-main-gles2/expo/CMakeLists.txt +--- compiz-plugins-main-package/expo/CMakeLists.txt 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/expo/CMakeLists.txt 2012-04-05 12:29:41.374453000 +0200 +@@ -1,7 +1,4 @@ + find_package (Compiz REQUIRED) +-include (FindOpenGL) + include (CompizPlugin) + +-if (OPENGL_GLU_FOUND) +- compiz_plugin (expo PLUGINDEPS composite opengl PKGDEPS cairo cairo-xlib-xrender LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR}) +-endif (OPENGL_GLU_FOUND) ++compiz_plugin (expo PLUGINDEPS composite opengl) +Binary files compiz-plugins-main-package/expo/images/glow_outline.png and compiz-plugins-main-gles2/expo/images/glow_outline.png differ +Binary files compiz-plugins-main-package/expo/images/texture_tile.png and compiz-plugins-main-gles2/expo/images/texture_tile.png differ +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/expo/src/expo.cpp compiz-plugins-main-gles2/expo/src/expo.cpp +--- compiz-plugins-main-package/expo/src/expo.cpp 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/expo/src/expo.cpp 2012-04-05 12:29:41.374453000 +0200 +@@ -4,12 +4,14 @@ + * + * expo.c + * ++ * Copyright (c) 2011 Linaro Limited + * Copyright (c) 2008 Dennis Kasprzyk + * Copyright (c) 2006 Robert Carr + * + * Authors: + * Robert Carr + * Dennis Kasprzyk ++ * Travis Watkins + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -25,7 +27,7 @@ + + #include "expo.h" + #include +-#include ++#include + #include + + COMPIZ_PLUGIN_20090315 (expo, ExpoPluginVTable); +@@ -658,15 +660,63 @@ + } + } + ++static bool ++unproject (float winx, float winy, float winz, ++ const GLMatrix &modelview, ++ const GLMatrix &projection, ++ const GLint viewport[4], ++ float *objx, float *objy, float *objz) ++{ ++ GLMatrix finalMatrix = projection * modelview; ++ float in[4], out[4]; ++ ++ if (!finalMatrix.invert ()) ++ return false; ++ ++ in[0] = winx; ++ in[1] = winy; ++ in[2] = winz; ++ in[3] = 1.0; ++ ++ /* Map x and y from window coordinates */ ++ in[0] = (in[0] - viewport[0]) / viewport[2]; ++ in[1] = (in[1] - viewport[1]) / viewport[3]; ++ ++ /* Map to range -1 to 1 */ ++ in[0] = in[0] * 2 - 1; ++ in[1] = in[1] * 2 - 1; ++ in[2] = in[2] * 2 - 1; ++ ++ for (int i = 0; i < 4; i++) ++ { ++ out[i] = in[0] * finalMatrix[i] + ++ in[1] * finalMatrix[4 + i] + ++ in[2] * finalMatrix[8 + i] + ++ in[3] * finalMatrix[12 + i]; ++ } ++ ++ if (out[3] == 0.0) ++ return false; ++ ++ out[0] /= out[3]; ++ out[1] /= out[3]; ++ out[2] /= out[3]; ++ ++ *objx = out[0]; ++ *objy = out[1]; ++ *objz = out[2]; ++ ++ return true; ++} ++ + void +-ExpoScreen::invertTransformedVertex (const GLScreenPaintAttrib& attrib, +- const GLMatrix& transform, +- CompOutput *output, +- int vertex[2]) ++ExpoScreen::invertTransformedVertex (const GLScreenPaintAttrib &attrib, ++ const GLMatrix &transform, ++ CompOutput *output, ++ int vertex[2]) + { + GLMatrix sTransform (transform); +- GLdouble p1[3], p2[3], v[3], alpha; +- GLdouble mvm[16], pm[16]; ++ float p1[3], p2[3], v[3], alpha; + GLint viewport[4]; + int i; + +@@ -674,16 +724,13 @@ + sTransform.toScreenSpace (output, -attrib.zTranslate); + + glGetIntegerv (GL_VIEWPORT, viewport); +- for (i = 0; i < 16; i++) +- { +- mvm[i] = sTransform[i]; +- pm[i] = gScreen->projectionMatrix ()[i]; +- } + +- gluUnProject (vertex[0], screen->height () - vertex[1], 0, mvm, pm, +- viewport, &p1[0], &p1[1], &p1[2]); +- gluUnProject (vertex[0], screen->height () - vertex[1], -1.0, mvm, pm, +- viewport, &p2[0], &p2[1], &p2[2]); ++ unproject (vertex[0], screen->height () - vertex[1], 0, ++ sTransform, *gScreen->projectionMatrix (), viewport, ++ &p1[0], &p1[1], &p1[2]); ++ unproject (vertex[0], screen->height () - vertex[1], -1.0, ++ sTransform, *gScreen->projectionMatrix (), viewport, ++ &p2[0], &p2[1], &p2[2]); + + for (i = 0; i < 3; i++) + v[i] = p1[i] - p2[i]; +@@ -855,6 +902,8 @@ + unsigned int mask, + bool reflection) + { ++ GLfloat vertexData[12]; ++ GLushort colorData[16]; + GLMatrix sTransformW, sTransform (transform); + GLenum oldFilter = gScreen->textureFilter (); + float sx = (float) screen->width () / output->width (); +@@ -873,6 +922,8 @@ + int glPaintTransformedOutputIndex = + gScreen->glPaintTransformedOutputGetCurrentIndex (); + ++ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); ++ + // Make sure that the base glPaintTransformedOutput function is called + gScreen->glPaintTransformedOutputSetCurrentIndex (MAXSHORT); + +@@ -965,7 +1016,7 @@ + /* zoom out */ + oScale = DEFAULT_Z_CAMERA / (cam[GLVector::z] + DEFAULT_Z_CAMERA); + sTransform.scale (oScale, oScale, oScale); +- glNormal3f (0.0, 0.0, -oScale); ++// glNormal3f (0.0, 0.0, -oScale); + sTransform.translate (-cam[GLVector::x], -cam[GLVector::y], + -cam[GLVector::z] - DEFAULT_Z_CAMERA); + +@@ -1058,73 +1109,167 @@ + + paintingDndWindow = false; + +- glNormal3f (0.0, 0.0, -1.0); ++// glNormal3f (0.0, 0.0, -1.0); + + if (reflection) + { +- glEnable (GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + +- glPushMatrix (); +- + if (optionGetDeform () != DeformCurve) + { +- glLoadMatrixf (sTransformW.getMatrix ()); ++ streamingBuffer->begin (GL_TRIANGLE_STRIP); ++ ++ colorData[0] = 0; ++ colorData[1] = 0; ++ colorData[2] = 0; ++ colorData[3] = 65535; ++ colorData[4] = 0; ++ colorData[5] = 0; ++ colorData[6] = 0; ++ colorData[7] = 32768; ++ colorData[8] = 0; ++ colorData[9] = 0; ++ colorData[10] = 0; ++ colorData[11] = 65535; ++ colorData[12] = 0; ++ colorData[13] = 0; ++ colorData[14] = 0; ++ colorData[15] = 32768; ++ ++ vertexData[0] = 0; ++ vertexData[1] = 0; ++ vertexData[2] = 0; ++ vertexData[3] = 0; ++ vertexData[4] = -vpSize.y () * (sy + gapY); ++ vertexData[5] = 0; ++ vertexData[6] = vpSize.x () * sx * (1.0 + gapX); ++ vertexData[7] = 0; ++ vertexData[8] = 0; ++ vertexData[9] = vpSize.x () * sx * (1.0 + gapX); ++ vertexData[10] = -vpSize.y () * sy * (1.0 + gapY); ++ vertexData[11] = 0; ++ ++ streamingBuffer->addColors (4, colorData); ++ streamingBuffer->addVertices (4, vertexData); + +- glBegin (GL_QUADS); +- glColor4f (0.0, 0.0, 0.0, 1.0); +- glVertex2f (0.0, 0.0); +- glColor4f (0.0, 0.0, 0.0, 0.5); +- glVertex2f (0.0, -vpSize.y () * (sy + gapY)); +- glVertex2f (vpSize.x () * sx * (1.0 + gapX), +- -vpSize.y () * sy * (1.0 + gapY)); +- glColor4f (0.0, 0.0, 0.0, 1.0); +- glVertex2f (vpSize.x () * sx * (1.0 + gapX), 0.0); +- glEnd (); ++ streamingBuffer->end (); ++ streamingBuffer->render (sTransformW); + } + else + { ++ GLMatrix cTransform; ++ cTransform.translate (0.0, 0.0, -DEFAULT_Z_CAMERA); ++ + glCullFace (GL_BACK); +- glLoadIdentity (); +- glTranslatef (0.0, 0.0, -DEFAULT_Z_CAMERA); + +- glBegin (GL_QUADS); +- glColor4f (0.0, 0.0, 0.0, 1.0 * expoCam); +- glVertex2f (-0.5, -0.5); +- glVertex2f (0.5, -0.5); +- glColor4f (0.0, 0.0, 0.0, 0.5 * expoCam); +- glVertex2f (0.5, 0.0); +- glVertex2f (-0.5, 0.0); +- glColor4f (0.0, 0.0, 0.0, 0.5 * expoCam); +- glVertex2f (-0.5, 0.0); +- glVertex2f (0.5, 0.0); +- glColor4f (0.0, 0.0, 0.0, 0.0); +- glVertex2f (0.5, 0.5); +- glVertex2f (-0.5, 0.5); +- glEnd (); ++ streamingBuffer->begin (GL_TRIANGLE_STRIP); ++ ++ colorData[0] = 0; ++ colorData[1] = 0; ++ colorData[2] = 0; ++ colorData[3] = (1.0 * expoCam) * 65536; ++ colorData[4] = 0; ++ colorData[5] = 0; ++ colorData[6] = 0; ++ colorData[7] = (1.0 * expoCam) * 65536; ++ colorData[8] = 0; ++ colorData[9] = 0; ++ colorData[10] = 0; ++ colorData[11] = (0.5 * expoCam) * 65536; ++ colorData[12] = 0; ++ colorData[13] = 0; ++ colorData[14] = 0; ++ colorData[15] = (0.5 * expoCam) * 65536; ++ ++ vertexData[0] = -0.5; ++ vertexData[1] = -0.5; ++ vertexData[2] = 0; ++ vertexData[3] = 0.5; ++ vertexData[4] = -0.5; ++ vertexData[5] = 0; ++ vertexData[6] = -0.5; ++ vertexData[7] = 0; ++ vertexData[8] = 0; ++ vertexData[9] = 0.5; ++ vertexData[10] = 0; ++ vertexData[11] = 0; ++ ++ streamingBuffer->addColors (4, colorData); ++ streamingBuffer->addVertices (4, vertexData); ++ ++ streamingBuffer->end (); ++ streamingBuffer->render (cTransform); ++ ++ streamingBuffer->begin (GL_TRIANGLE_STRIP); ++ ++ colorData[0] = 0; ++ colorData[1] = 0; ++ colorData[2] = 0; ++ colorData[3] = (0.5 * expoCam) * 65536; ++ colorData[4] = 0; ++ colorData[5] = 0; ++ colorData[6] = 0; ++ colorData[7] = (0.5 * expoCam) * 65536; ++ colorData[8] = 0; ++ colorData[9] = 0; ++ colorData[10] = 0; ++ colorData[11] = 0; ++ colorData[12] = 0; ++ colorData[13] = 0; ++ colorData[14] = 0; ++ colorData[15] = 0; ++ ++ vertexData[0] = -0.5; ++ vertexData[1] = 0; ++ vertexData[2] = 0; ++ vertexData[3] = 0.5; ++ vertexData[4] = 0; ++ vertexData[5] = 0; ++ vertexData[6] = -0.5; ++ vertexData[7] = 0.5; ++ vertexData[8] = 0; ++ vertexData[9] = 0.5; ++ vertexData[10] = 0.5; ++ vertexData[11] = 0; ++ ++ streamingBuffer->addColors (4, colorData); ++ streamingBuffer->addVertices (4, vertexData); ++ ++ streamingBuffer->end (); ++ streamingBuffer->render (cTransform); + } + glCullFace (GL_BACK); + +- glLoadIdentity (); +- glTranslatef (0.0, 0.0, -DEFAULT_Z_CAMERA); +- + if (optionGetGroundSize () > 0.0) + { +- glBegin (GL_QUADS); +- glColor4usv (optionGetGroundColor1 ()); +- glVertex2f (-0.5, -0.5); +- glVertex2f (0.5, -0.5); +- glColor4usv (optionGetGroundColor2 ()); +- glVertex2f (0.5, -0.5 + optionGetGroundSize ()); +- glVertex2f (-0.5, -0.5 + optionGetGroundSize ()); +- glEnd (); +- } ++ GLMatrix gTransform; ++ gTransform.translate (0.0, 0.0, -DEFAULT_Z_CAMERA); + +- glColor4usv (defaultColor); ++ streamingBuffer->begin (GL_TRIANGLE_STRIP); + ++ vertexData[0] = -0.5; ++ vertexData[1] = -0.5; ++ vertexData[2] = 0; ++ vertexData[3] = 0.5; ++ vertexData[4] = -0.5; ++ vertexData[5] = 0; ++ vertexData[6] = -0.5; ++ vertexData[7] = -0.5 + optionGetGroundSize (); ++ vertexData[8] = 0; ++ vertexData[9] = 0.5; ++ vertexData[10] = -0.5 + optionGetGroundSize (); ++ vertexData[11] = 0; ++ ++ streamingBuffer->addColors (1, optionGetGroundColor1 ()); ++ streamingBuffer->addColors (1, optionGetGroundColor1 ()); ++ streamingBuffer->addColors (1, optionGetGroundColor2 ()); ++ streamingBuffer->addColors (1, optionGetGroundColor2 ()); ++ streamingBuffer->addVertices (4, vertexData); ++ ++ streamingBuffer->end (); ++ streamingBuffer->render (gTransform); ++ } + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); +- glDisable (GL_BLEND); +- glPopMatrix (); + } + + expoActive = false; +@@ -1188,10 +1333,10 @@ + } + + bool +-ExpoWindow::glDraw (const GLMatrix& transform, +- GLFragment::Attrib& fragment, +- const CompRegion& region, +- unsigned int mask) ++ExpoWindow::glDraw (const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, ++ const CompRegion ®ion, ++ unsigned int mask) + { + GLMatrix wTransform (transform); + CompPoint vp; +@@ -1199,17 +1344,17 @@ + screen->viewportForGeometry (window->geometry (), vp); + + if (eScreen->expoCam == 0.0f) +- return gWindow->glDraw (transform, fragment, region, mask); ++ return gWindow->glDraw (transform, attrib, region, mask); + +- GLFragment::Attrib fA (fragment); +- int expoAnimation; ++ GLWindowPaintAttrib eAttrib (attrib); ++ int expoAnimation; + + expoAnimation = eScreen->optionGetExpoAnimation (); + + if (eScreen->expoActive) + { + if (expoAnimation != ExpoScreen::ExpoAnimationZoom) +- fA.setOpacity (fragment.getOpacity () * eScreen->expoCam); ++ eAttrib.opacity = attrib.opacity * eScreen->expoCam; + + if (window->wmType () & CompWindowTypeDockMask && + eScreen->optionGetHideDocks ()) +@@ -1217,31 +1362,31 @@ + if (expoAnimation == ExpoScreen::ExpoAnimationZoom && + eScreen->paintingVp == eScreen->selectedVp) + { +- fA.setOpacity (fragment.getOpacity () * +- (1 - sigmoidProgress (eScreen->expoCam))); ++ eAttrib.opacity = attrib.opacity * ++ (1 - sigmoidProgress (eScreen->expoCam)); + } + else + { +- fA.setOpacity (0); ++ eAttrib.opacity = 0; + } + } + +- if (vp == eScreen->paintingVp || window->onAllViewports ()) ++ if ((vp == eScreen->paintingVp || window->onAllViewports ()) && !eScreen->paintingDndWindow) + { +- fA.setBrightness (fragment.getBrightness () * eScreen->vpBrightness); +- fA.setSaturation (fragment.getSaturation () * eScreen->vpSaturation); ++ eAttrib.brightness = attrib.brightness * eScreen->vpBrightness; ++ eAttrib.saturation = attrib.saturation * eScreen->vpSaturation; + } + } + else + { + if (expoAnimation == ExpoScreen::ExpoAnimationZoom) +- fA.setBrightness (0); ++ eAttrib.brightness = 0; + else +- fA.setBrightness (fragment.getBrightness () * +- (1 - sigmoidProgress (eScreen->expoCam))); ++ eAttrib.brightness = attrib.brightness * ++ (1 - sigmoidProgress (eScreen->expoCam)); + } + +- bool status = gWindow->glDraw (wTransform, fA, region, mask); ++ bool status = gWindow->glDraw (transform, eAttrib, region, mask); + + if (window->type () & CompWindowTypeDesktopMask) + { +@@ -1255,10 +1400,6 @@ + GLTexture::Matrix mat = tex->matrix(); + CompRegion paintRegion(region); + +- /* We can reset the window geometry since it will be +- * re-added later */ +- gWindow->geometry().reset(); +- + float xScale = screen->width () / (float) eScreen->viewport_size.width (); + float yScale = screen->height () / (float) eScreen->viewport_size.height (); + +@@ -1278,27 +1419,26 @@ + /* Now allow plugins to mess with the geometry of our + * dim (so we get a nice render for things like + * wobbly etc etc */ ++ gWindow->vertexBuffer()->begin(); + gWindow->glAddGeometry(matl, reg, paintRegion); ++ gWindow->vertexBuffer()->end(); + +- /* Did it succeed? */ +- if (gWindow->geometry().vertices) +- { +- unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex(); +- fA.setOpacity (fragment.getOpacity () * (((1.0 - eScreen->vpBrightness) + (1.0 - eScreen->vpSaturation) / 2.0))); +- /* Texture rendering set-up */ +- eScreen->gScreen->setTexEnvMode(GL_MODULATE); +- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); +- /* Draw the dim texture with all of it's modified +- * geometry glory */ +- gWindow->glDrawTextureSetCurrentIndex(MAXSHORT); +- gWindow->glDrawTexture(tex, fA, mask | PAINT_WINDOW_BLEND_MASK +- | PAINT_WINDOW_TRANSLUCENT_MASK | +- PAINT_WINDOW_TRANSFORMED_MASK); +- gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex); +- /* Texture rendering tear-down */ +- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); +- eScreen->gScreen->setTexEnvMode(GL_REPLACE); +- } ++ unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex(); ++ eAttrib.opacity = attrib.opacity * (((1.0 - eScreen->vpBrightness) + (1.0 - eScreen->vpSaturation) / 2.0)); ++ /* Texture rendering set-up */ ++ //eScreen->gScreen->setTexEnvMode(GL_MODULATE); ++ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); ++ /* Draw the dim texture with all of it's modified ++ * geometry glory */ ++ gWindow->glDrawTextureSetCurrentIndex(MAXSHORT); ++ gWindow->glDrawTexture(tex, transform, eAttrib, mask | ++ PAINT_WINDOW_BLEND_MASK | ++ PAINT_WINDOW_TRANSLUCENT_MASK | ++ PAINT_WINDOW_TRANSFORMED_MASK); ++ gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex); ++ /* Texture rendering tear-down */ ++ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); ++ eScreen->gScreen->setTexEnvMode(GL_REPLACE); + } + + /* Paint the outline */ +@@ -1307,9 +1447,10 @@ + if (region.numRects ()) + { + /* reset geometry and paint */ +- gWindow->geometry ().reset (); ++ gWindow->vertexBuffer ()->begin (); ++ gWindow->vertexBuffer ()->end (); + +- paintGlow (fragment, infiniteRegion, mask); ++ paintGlow (transform, attrib, infiniteRegion, mask); + } + } + +@@ -1322,17 +1463,18 @@ + #define EXPO_GRID_SIZE 100 + + void +-ExpoWindow::glAddGeometry (const GLTexture::MatrixList& matrices, +- const CompRegion& region, +- const CompRegion& clip, +- unsigned int maxGridWidth, +- unsigned int maxGridHeight) ++ExpoWindow::glAddGeometry (const GLTexture::MatrixList &matrices, ++ const CompRegion ®ion, ++ const CompRegion &clip, ++ unsigned int maxGridWidth, ++ unsigned int maxGridHeight) + { + if (eScreen->expoCam > 0.0 && + screen->desktopWindowCount () && + eScreen->optionGetDeform () == ExpoScreen::DeformCurve) + { +- int i, oldVCount = gWindow->geometry ().vCount; ++ #warning Curve not ported, needs shaders now ++/* int i, oldVCount = gWindow->geometry ().vCount; + GLfloat *v; + CompPoint offset; + float lastX, lastZ = 0.0; +@@ -1377,7 +1519,7 @@ + lastZ = v[2]; + + v += gWindow->geometry ().vertexStride; +- } ++ } */ + } + else + { +@@ -1386,16 +1528,18 @@ + } + + void +-ExpoWindow::glDrawTexture (GLTexture *texture, +- GLFragment::Attrib& attrib, +- unsigned int mask) ++ExpoWindow::glDrawTexture (GLTexture *texture, ++ const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, ++ unsigned int mask) + { + if (eScreen->expoCam > 0.0 && + eScreen->optionGetDeform () == ExpoScreen::DeformCurve && + eScreen->gScreen->lighting () && + screen->desktopWindowCount ()) + { +- unsigned int i, idx, vCount; ++ #warning Curve not ported, needs shaders now ++/* unsigned int i, idx, vCount; + CompPoint offset; + float x; + GLfloat *v; +@@ -1442,13 +1586,13 @@ + + glDisable (GL_NORMALIZE); + glDisableClientState (GL_NORMAL_ARRAY); +- glNormal3f (0.0, 0.0, -1.0); ++ glNormal3f (0.0, 0.0, -1.0); */ + } + else + { +- glEnable (GL_NORMALIZE); +- gWindow->glDrawTexture (texture, attrib, mask); +- glDisable (GL_NORMALIZE); ++// glEnable (GL_NORMALIZE); ++ gWindow->glDrawTexture (texture, transform, attrib, mask); ++// glDisable (GL_NORMALIZE); + } + } + +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/expo/src/expo.h compiz-plugins-main-gles2/expo/src/expo.h +--- compiz-plugins-main-package/expo/src/expo.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/expo/src/expo.h 2012-04-05 12:29:41.374453000 +0200 +@@ -29,9 +29,6 @@ + #include + #include + +-#include +-#include +- + #include "expo_options.h" + #include "glow.h" + +@@ -60,20 +57,20 @@ + void donePaint (); + + bool glPaintOutput (const GLScreenPaintAttrib&, const GLMatrix&, +- const CompRegion&, CompOutput *, unsigned int); ++ const CompRegion&, CompOutput *, unsigned int); + void glPaintTransformedOutput (const GLScreenPaintAttrib&, +- const GLMatrix&, const CompRegion&, +- CompOutput *, unsigned int); ++ const GLMatrix&, const CompRegion&, ++ CompOutput*, unsigned int); + + const CompWindowList & getWindowPaintList (); + +- bool dndInit (CompAction *, CompAction::State, CompOption::Vector&); +- bool dndFini (CompAction *, CompAction::State, CompOption::Vector&); +- bool doExpo (CompAction *, CompAction::State, CompOption::Vector&); +- bool exitExpo (CompAction *, CompAction::State, CompOption::Vector&); +- bool termExpo (CompAction *, CompAction::State, CompOption::Vector&); +- bool nextVp (CompAction *, CompAction::State, CompOption::Vector&); +- bool prevVp (CompAction *, CompAction::State, CompOption::Vector&); ++ bool dndInit (CompAction*, CompAction::State, CompOption::Vector&); ++ bool dndFini (CompAction*, CompAction::State, CompOption::Vector&); ++ bool doExpo (CompAction*, CompAction::State, CompOption::Vector&); ++ bool exitExpo (CompAction*, CompAction::State, CompOption::Vector&); ++ bool termExpo (CompAction*, CompAction::State, CompOption::Vector&); ++ bool nextVp (CompAction*, CompAction::State, CompOption::Vector&); ++ bool prevVp (CompAction*, CompAction::State, CompOption::Vector&); + + CompPoint currentViewport (); + +@@ -144,9 +141,9 @@ + void updateWraps (bool); + + void invertTransformedVertex (const GLScreenPaintAttrib&, +- const GLMatrix&, CompOutput *, int[2]); ++ const GLMatrix&, CompOutput *, int[2]); + void paintWall (const GLScreenPaintAttrib&, const GLMatrix&, +- const CompRegion&, CompOutput *, unsigned int, bool); ++ const CompRegion&, CompOutput *, unsigned int, bool); + + void paintViewport (const GLScreenPaintAttrib& attrib, + const GLMatrix& transform, +@@ -181,18 +178,18 @@ + + void resizeNotify (int dx, int dy, int dw, int dh); + +- bool glDraw (const GLMatrix&, GLFragment::Attrib&, +- const CompRegion&, unsigned int); ++ bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&, ++ const CompRegion&, unsigned int); + bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&, +- const CompRegion&, unsigned int); ++ const CompRegion&, unsigned int); + void glAddGeometry (const GLTexture::MatrixList&, +- const CompRegion&, const CompRegion&, +- unsigned int, unsigned int); +- void glDrawTexture (GLTexture *, GLFragment::Attrib& attrib, +- unsigned int); +- ++ const CompRegion&, const CompRegion&, ++ unsigned int, unsigned int); ++ void glDrawTexture (GLTexture*, const GLMatrix&, ++ const GLWindowPaintAttrib&, unsigned int); + void +- paintGlow (GLFragment::Attrib &attrib, ++ paintGlow (const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, + const CompRegion &paintRegion, + unsigned int mask); + +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/expo/src/glow.cpp compiz-plugins-main-gles2/expo/src/glow.cpp +--- compiz-plugins-main-package/expo/src/glow.cpp 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/expo/src/glow.cpp 2012-04-05 12:29:41.374453000 +0200 +@@ -42,12 +42,24 @@ + */ + + void +-ExpoWindow::paintGlow (GLFragment::Attrib &attrib, +- const CompRegion &paintRegion, +- unsigned int mask) ++ExpoWindow::paintGlow (const GLMatrix &transform, ++ const GLWindowPaintAttrib &attrib, ++ const CompRegion &paintRegion, ++ unsigned int mask) + { +- CompRegion reg; +- int i; ++ CompRegion reg; ++ int i; ++ GLushort colorData[4]; ++ const GLushort *selColorData = ExpoScreen::get (screen)->optionGetSelectedColor (); ++ float alpha = (float) selColorData[3] / 65535.0f; ++ ++ /* Premultiply color */ ++ colorData[0] = selColorData[0] * alpha; ++ colorData[1] = selColorData[1] * alpha; ++ colorData[2] = selColorData[2] * alpha; ++ colorData[3] = selColorData[3]; ++ ++ gWindow->vertexBuffer ()->begin (); + + /* There are 8 glow parts of the glow texture which we wish to paint + * separately with different transformations +@@ -67,42 +79,30 @@ + reg.boundingRect ().height ()); + + matl.push_back (mGlowQuads[i].mMatrix); ++ /* Add color data for all 6 vertices of the quad */ ++ for (int n = 0; n < 6; n++) ++ gWindow->vertexBuffer ()->addColors (1, colorData); + gWindow->glAddGeometry (matl, reg, paintRegion); + } + } + +- /* If the geometry add succeeded */ +- if (gWindow->geometry ().vertices) +- { +- GLFragment::Attrib fAttrib (attrib); +- GLushort average; +- GLushort color[3] = {MAXSHORT, +- MAXSHORT, +- MAXSHORT}; +- +- float alpha = (float) ExpoScreen::get (screen)->optionGetSelectedColorAlpha () / 65535.0f; +- +- GLScreen::get (screen)->setTexEnvMode (GL_MODULATE); +- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +- glColor4f (((float) ExpoScreen::get (screen)->optionGetSelectedColorRed () / 65535.0f) * alpha, +- ((float) ExpoScreen::get (screen)->optionGetSelectedColorGreen () / 65535.0f) * alpha, +- ((float) ExpoScreen::get (screen)->optionGetSelectedColorBlue () / 65535.0f) * alpha, +- alpha); +- +- /* we use PAINT_WINDOW_TRANSFORMED_MASK here to force +- the usage of a good texture filter */ +- foreach (GLTexture *tex, ExpoScreen::get (screen)->outline_texture) +- { +- gWindow->glDrawTexture (tex, fAttrib, mask | +- PAINT_WINDOW_BLEND_MASK | +- PAINT_WINDOW_TRANSLUCENT_MASK | +- PAINT_WINDOW_TRANSFORMED_MASK); +- } ++ gWindow->vertexBuffer ()->end (); + +- glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); +- GLScreen::get (screen)->setTexEnvMode (GL_REPLACE); +- glColor4usv (defaultColor); ++ //GLScreen::get (screen)->setTexEnvMode (GL_MODULATE); ++ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ++ ++ /* we use PAINT_WINDOW_TRANSFORMED_MASK here to force ++ the usage of a good texture filter */ ++ foreach (GLTexture *tex, ExpoScreen::get (screen)->outline_texture) ++ { ++ gWindow->glDrawTexture (tex, transform, attrib, mask | ++ PAINT_WINDOW_BLEND_MASK | ++ PAINT_WINDOW_TRANSLUCENT_MASK | ++ PAINT_WINDOW_TRANSFORMED_MASK); + } ++ ++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); ++ GLScreen::get (screen)->setTexEnvMode (GL_REPLACE); + } + + /* +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/ezoom/ezoom.xml.in compiz-plugins-main-gles2/ezoom/ezoom.xml.in +--- compiz-plugins-main-package/ezoom/ezoom.xml.in 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/ezoom/ezoom.xml.in 2012-04-05 12:29:41.374453000 +0200 +@@ -29,6 +29,7 @@ + + + + + +@@ -138,7 +141,7 @@ + + + +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/ezoom/src/ezoom.cpp compiz-plugins-main-gles2/ezoom/src/ezoom.cpp +--- compiz-plugins-main-package/ezoom/src/ezoom.cpp 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/ezoom/src/ezoom.cpp 2012-04-05 12:29:41.374453000 +0200 +@@ -378,13 +378,16 @@ + /* Draws a box from the screen coordinates inx1,iny1 to inx2,iny2 */ + void + EZoomScreen::drawBox (const GLMatrix &transform, +- CompOutput *output, +- CompRect box) ++ CompOutput *output, ++ CompRect box) + { +- GLMatrix zTransform = transform; +- int x1,x2,y1,y2; +- int inx1, inx2, iny1, iny2; +- int out = output->id (); ++ GLMatrix zTransform (transform); ++ int x1, x2, y1, y2; ++ int inx1, inx2, iny1, iny2; ++ int out = output->id (); ++ GLushort colorData[4]; ++ GLfloat vertexData[12]; ++ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); + + zTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA); + convertToZoomed (out, box.x1 (), box.y1 (), &inx1, &iny1); +@@ -394,23 +397,61 @@ + y1 = MIN (iny1, iny2); + x2 = MAX (inx1, inx2); + y2 = MAX (iny1, iny2); +- glPushMatrix (); +- glLoadMatrixf (zTransform.getMatrix ()); +- glDisableClientState (GL_TEXTURE_COORD_ARRAY); +- glEnable (GL_BLEND); +- glColor4us (0x2fff, 0x2fff, 0x4fff, 0x4fff); +- glRecti (x1,y2,x2,y1); +- glColor4us (0x2fff, 0x2fff, 0x4fff, 0x9fff); +- glBegin (GL_LINE_LOOP); +- glVertex2i (x1, y1); +- glVertex2i (x2, y1); +- glVertex2i (x2, y2); +- glVertex2i (x1, y2); +- glEnd (); +- glColor4usv (defaultColor); +- glDisable (GL_BLEND); +- glEnableClientState (GL_TEXTURE_COORD_ARRAY); +- glPopMatrix (); ++ ++ streamingBuffer->begin (GL_TRIANGLE_STRIP); ++ ++ colorData[0] = 0x2fff; ++ colorData[1] = 0x2fff; ++ colorData[2] = 0x2fff; ++ colorData[3] = 0x4fff; ++ ++ streamingBuffer->addColors (1, colorData); ++ ++ vertexData[0] = x1; ++ vertexData[1] = y1; ++ vertexData[2] = 0.0f; ++ vertexData[3] = x1; ++ vertexData[4] = y2; ++ vertexData[5] = 0.0f; ++ vertexData[6] = x2; ++ vertexData[7] = y1; ++ vertexData[8] = 0.0f; ++ vertexData[9] = x2; ++ vertexData[10] = y2; ++ vertexData[11] = 0.0f; ++ ++ streamingBuffer->addVertices (4, vertexData); ++ ++ streamingBuffer->end (); ++ streamingBuffer->render (zTransform); ++ ++ ++ streamingBuffer->begin (GL_LINE_LOOP); ++ ++ colorData[0] = 0x2fff; ++ colorData[1] = 0x2fff; ++ colorData[2] = 0x4fff; ++ colorData[3] = 0x9fff; ++ ++ streamingBuffer->addColors (1, colorData); ++ ++ vertexData[0] = x1; ++ vertexData[1] = y1; ++ vertexData[2] = 0.0f; ++ vertexData[3] = x2; ++ vertexData[4] = y1; ++ vertexData[5] = 0.0f; ++ vertexData[6] = x2; ++ vertexData[7] = y2; ++ vertexData[8] = 0.0f; ++ vertexData[9] = x1; ++ vertexData[10] = y2; ++ vertexData[11] = 0.0f; ++ ++ streamingBuffer->addVertices (4, vertexData); ++ ++ streamingBuffer->end (); ++ streamingBuffer->render (zTransform); + } + /* Apply the zoom if we are grabbed. + * Make sure to use the correct filter. +@@ -1050,22 +1091,25 @@ + + /* Translate into place and draw the scaled cursor. */ + void +-EZoomScreen::drawCursor (CompOutput *output, +- const GLMatrix &transform) ++EZoomScreen::drawCursor (CompOutput *output, ++ const GLMatrix &transform) + { +- int out = output->id (); ++ int out = output->id (); + + if (cursor.isSet) + { +- GLMatrix sTransform = transform; +- float scaleFactor; +- int ax, ay, x, y; ++ GLMatrix sTransform (transform); ++ float scaleFactor; ++ int ax, ay, x, y; ++ GLfloat textureData[8]; ++ GLfloat vertexData[12]; ++ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); + + /* + * XXX: expo knows how to handle mouse when zoomed, so we back off + * when expo is active. + */ +- if (screen->grabExist ( "expo")) ++ if (screen->grabExist ("expo")) + { + cursorZoomInactive (); + return; +@@ -1073,63 +1117,77 @@ + + sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA); + convertToZoomed (out, mouse.x (), mouse.y (), &ax, &ay); +- glPushMatrix (); +- glLoadMatrixf (sTransform.getMatrix ()); +- glTranslatef ((float) ax, (float) ay, 0.0f); ++ sTransform.translate ((float) ax, (float) ay, 0.0f); ++ + if (optionGetScaleMouseDynamic ()) + scaleFactor = 1.0f / zooms.at (out).currentZoom; + else + scaleFactor = 1.0f / optionGetScaleMouseStatic (); +- glScalef (scaleFactor, +- scaleFactor, +- 1.0f); ++ ++ sTransform.scale (scaleFactor, scaleFactor, 1.0f); + x = -cursor.hotX; + y = -cursor.hotY; + +- glEnable (GL_BLEND); +- glBindTexture (GL_TEXTURE_RECTANGLE_ARB, cursor.texture); +- glEnable (GL_TEXTURE_RECTANGLE_ARB); +- +- glBegin (GL_QUADS); +- glTexCoord2d (0, 0); +- glVertex2f (x, y); +- glTexCoord2d (0, cursor.height); +- glVertex2f (x, y + cursor.height); +- glTexCoord2d (cursor.width, cursor.height); +- glVertex2f (x + cursor.width, y + cursor.height); +- glTexCoord2d (cursor.width, 0); +- glVertex2f (x + cursor.width, y); +- glEnd (); +- glDisable (GL_BLEND); +- glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); +- glDisable (GL_TEXTURE_RECTANGLE_ARB); +- glPopMatrix (); ++ glBindTexture (GL_TEXTURE_2D, cursor.texture); ++ ++ streamingBuffer->begin (GL_TRIANGLE_STRIP); ++ ++ vertexData[0] = x; ++ vertexData[1] = y; ++ vertexData[2] = 0.0f; ++ vertexData[3] = x; ++ vertexData[4] = y + cursor.height; ++ vertexData[5] = 0.0f; ++ vertexData[6] = x + cursor.width; ++ vertexData[7] = y; ++ vertexData[8] = 0.0f; ++ vertexData[9] = x + cursor.width; ++ vertexData[10] = y + cursor.height; ++ vertexData[11] = 0.0f; ++ ++ streamingBuffer->addVertices (4, vertexData); ++ ++ textureData[0] = 0; ++ textureData[1] = 0; ++ textureData[2] = 0; ++ textureData[3] = cursor.height; ++ textureData[4] = cursor.width; ++ textureData[5] = 0; ++ textureData[6] = cursor.width; ++ textureData[7] = cursor.height; ++ ++ streamingBuffer->addTexCoords (1, 4, textureData); ++ ++ streamingBuffer->end (); ++ streamingBuffer->render (sTransform); ++ ++ glBindTexture (GL_TEXTURE_2D, 0); + } + } + + /* Create (if necessary) a texture to store the cursor, + * fetch the cursor with XFixes. Store it. */ + void +-EZoomScreen::updateCursor (CursorTexture * cursor) ++EZoomScreen::updateCursor (CursorTexture *cursor) + { + unsigned char *pixels; +- int i; ++ int i; + Display *dpy = screen->dpy (); + + if (!cursor->isSet) + { + cursor->isSet = true; + cursor->screen = screen; +- glEnable (GL_TEXTURE_RECTANGLE_ARB); ++ ++ glEnable (GL_TEXTURE_2D); + glGenTextures (1, &cursor->texture); +- glBindTexture (GL_TEXTURE_RECTANGLE_ARB, cursor->texture); ++ glBindTexture (GL_TEXTURE_2D, cursor->texture); + +- glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, +- GL_TEXTURE_WRAP_S, GL_CLAMP); +- glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, +- GL_TEXTURE_WRAP_T, GL_CLAMP); +- } else { +- glEnable (GL_TEXTURE_RECTANGLE_ARB); ++ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ++ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ++ } ++ else { ++ glEnable (GL_TEXTURE_2D); + } + + XFixesCursorImage *ci = XFixesGetCursorImage (dpy); +@@ -1185,11 +1243,11 @@ + compLogMessage ("ezoom", CompLogLevelWarn, "unable to get system cursor image!"); + } + +- glBindTexture (GL_TEXTURE_RECTANGLE_ARB, cursor->texture); +- glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, cursor->width, ++ glBindTexture (GL_TEXTURE_2D, cursor->texture); ++ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, cursor->width, + cursor->height, 0, GL_BGRA, GL_UNSIGNED_BYTE, pixels); +- glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); +- glDisable (GL_TEXTURE_RECTANGLE_ARB); ++ glBindTexture (GL_TEXTURE_2D, 0); ++ glDisable (GL_TEXTURE_2D); + + free (pixels); + } +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/glow.cpp compiz-plugins-main-gles2/glow.cpp +--- compiz-plugins-main-package/glow.cpp 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/glow.cpp 1970-01-01 01:00:00.000000000 +0100 +@@ -1,428 +0,0 @@ +-/** +- * +- * Compiz group plugin +- * +- * glow.cpp +- * +- * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen, +- * Danny Baumann, Sam Spilsbury +- * Authors: Patrick Niklaus +- * Roi Cohen +- * Danny Baumann +- * Sam Spilsbury +- * +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * as published by the Free Software Foundation; either version 2 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- **/ +- +-#include "expo.h" +-#include "group_glow.h" +- +-const GlowTextureProperties glowTextureProperties = { +- /* GlowTextureRectangular */ +- glowTexRect, 32, 21 +-}; +- +-/* +- * GroupWindow::paintGlow +- * +- * Takes our glow texture, stretches the appropriate positions in the glow texture, +- * adds those geometries (so plugins like wobby and deform this texture correctly) +- * and then draws the glow texture with this geometry (plugins like wobbly and friends +- * will automatically deform the texture based on our set geometry) +- */ +- +-void +-ExpoWindow::paintGlow (GLFragment::Attrib &attrib, +- const CompRegion &paintRegion, +- unsigned int mask) +-{ +- CompRegion reg; +- int i; +- +- /* There are 8 glow parts of the glow texture which we wish to paint +- * separately with different transformations +- */ +- for (i = 0; i < NUM_GLOWQUADS; i++) +- { +- /* Using precalculated quads here */ +- reg = CompRegion (mGlowQuads[i].mBox); +- +- if (reg.boundingRect ().x1 () < reg.boundingRect ().x2 () && +- reg.boundingRect ().y1 () < reg.boundingRect ().y2 ()) +- { +- GLTexture::MatrixList matl; +- reg = CompRegion (reg.boundingRect ().x1 (), +- reg.boundingRect ().y1 (), +- reg.boundingRect ().width (), +- reg.boundingRect ().height ()); +- +- matl.push_back (mGlowQuads[i].mMatrix); +- gWindow->glAddGeometry (matl, reg, paintRegion); +- } +- } +- +- /* If the geometry add succeeded */ +- if (gWindow->geometry ().vertices) +- { +- GLFragment::Attrib fAttrib (attrib); +- GLushort average; +- GLushort color[3] = {MAXSHORT, +- MAXSHORT, +- MAXSHORT}; +- +- float alpha = (float) ExpoScreen::get (screen)->optionGetSelectedColorAlpha () / 65535.0f; +- +- GLScreen::get (screen)->setTexEnvMode (GL_MODULATE); +- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +- glColor4f (((float) ExpoScreen::get (screen)->optionGetSelectedColorRed () / 65535.0f) * alpha, +- ((float) ExpoScreen::get (screen)->optionGetSelectedColorGreen () / 65535.0f) * alpha, +- ((float) ExpoScreen::get (screen)->optionGetSelectedColorBlue () / 65535.0f) * alpha, +- alpha); +- +- /* we use PAINT_WINDOW_TRANSFORMED_MASK here to force +- the usage of a good texture filter */ +- foreach (GLTexture *tex, ExpoScreen::get (screen)->outline_texture) +- { +- gWindow->glDrawTexture (tex, fAttrib, mask | +- PAINT_WINDOW_BLEND_MASK | +- PAINT_WINDOW_TRANSLUCENT_MASK | +- PAINT_WINDOW_TRANSFORMED_MASK); +- } +- +- glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); +- GLScreen::get (screen)->setTexEnvMode (GL_REPLACE); +- glColor4usv (defaultColor); +- } +-} +- +-/* +- * ExpoWindow::computeGlowQuads +- * +- * This function computures the matrix transformation required for each +- * part of the glow texture which we wish to stretch to some rectangular +- * dimentions +- * +- * There are eight quads different parts of the texture which we wish to +- * paint here, the 4 sides and four corners, eg: +- * +- * ------------------ +- * | 1 | 4 | 6 | +- * ------------- ------------------ +- * | 1 | 4 | 6 | | | | | +- * ------------- | | | | +- * | 2 | n | 7 | -> | 2 | n | 7 | +- * ------------- | | | | +- * | 3 | 5 | 8 | | | | | +- * ------------- ------------------ +- * | 3 | 5 | 8 | +- * ------------------ +- * +- * In this example here, 2, 4, 5 and 7 are stretched, and the matrices for +- * each quad rect adjusted accordingly for it's size compared to the original +- * texture size. +- * +- * When we are adjusting the matrices here, the initial size of each corner has +- * a size of of "1.0f", so according to 2x2 matrix rules, +- * the scale factor is the inverse of the size of the glow (which explains +- * while you will see here that matrix->xx is (1 / glowSize) +- * where glowSize is the size the user specifies they want their glow to extend. +- * (likewise, matrix->yy is adjusted similarly for corners and for top/bottom) +- * +- * matrix->x0 and matrix->y0 here are set to be the top left edge of the rect +- * adjusted by the matrix scale factor (matrix->xx and matrix->yy) +- * +- */ +-void +-ExpoWindow::computeGlowQuads (GLTexture::Matrix *matrix) +-{ +- CompRect *box; +- int x1, x2, y1, y2; +- GLTexture::Matrix *quadMatrix; +- int glowSize, glowOffset; +- CompWindow *w = window; +- +- /* Passing NULL to this function frees the glow quads +- * (so the window is not painted with glow) */ +- +- if (matrix) +- { +- if (!mGlowQuads) +- mGlowQuads = new GlowQuad[NUM_GLOWQUADS]; +- if (!mGlowQuads) +- return; +- } +- else +- { +- if (mGlowQuads) +- { +- delete[] mGlowQuads; +- mGlowQuads = NULL; +- } +- return; +- } +- +- glowSize = 48; +- glowOffset = (glowSize * ExpoScreen::get (screen)->mGlowTextureProperties->glowOffset / +- ExpoScreen::get (screen)->mGlowTextureProperties->textureSize) + 1; +- +- /* Top left corner */ +- box = &mGlowQuads[GLOWQUAD_TOPLEFT].mBox; +- mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix; +- +- /* Set the desired rect dimentions +- * for the part of the glow we are painting */ +- +- x1 = WIN_REAL_X (w) - glowSize + glowOffset; +- y1 = WIN_REAL_Y (w) - glowSize + glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * Scaling both parts of the texture in a positive direction +- * here (left to right top to bottom) +- * +- * The base position (x0 and y0) here requires us to move backwards +- * on the x and y dimentions by the calculated rect dimentions +- * multiplied by the scale factors +- */ +- +- quadMatrix->xx = 1.0f / glowSize; +- quadMatrix->yy = 1.0f / (glowSize); +- quadMatrix->x0 = -(x1 * quadMatrix->xx); +- quadMatrix->y0 = -(y1 * quadMatrix->yy); +- +- x2 = MIN (WIN_REAL_X (w) + glowOffset, +- WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2)); +- y2 = MIN (WIN_REAL_Y (w) + glowOffset, +- WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2)); +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Top right corner */ +- box = &mGlowQuads[GLOWQUAD_TOPRIGHT].mBox; +- mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix; +- +- /* Set the desired rect dimentions +- * for the part of the glow we are painting */ +- +- x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset; +- y1 = WIN_REAL_Y (w) - glowSize + glowOffset; +- x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * Scaling the y part of the texture in a positive direction +- * and the x part in a negative direction here +- * (right to left top to bottom) +- * +- * The base position (x0 and y0) here requires us to move backwards +- * on the y dimention and forwards on x by the calculated rect dimentions +- * multiplied by the scale factors (since we are moving forward on x we +- * need the inverse of that which is 1 - x1 * xx +- */ +- +- quadMatrix->xx = -1.0f / glowSize; +- quadMatrix->yy = 1.0f / glowSize; +- quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx); +- quadMatrix->y0 = -(y1 * quadMatrix->yy); +- +- x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset, +- WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2)); +- y2 = MIN (WIN_REAL_Y (w) + glowOffset, +- WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2)); +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Bottom left corner */ +- box = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mBox; +- mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix; +- +- x1 = WIN_REAL_X (w) - glowSize + glowOffset; +- y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset; +- x2 = WIN_REAL_X (w) + glowOffset; +- y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * Scaling the x part of the texture in a positive direction +- * and the y part in a negative direction here +- * (left to right bottom to top) +- * +- * The base position (x0 and y0) here requires us to move backwards +- * on the x dimention and forwards on y by the calculated rect dimentions +- * multiplied by the scale factors (since we are moving forward on x we +- * need the inverse of that which is 1 - y1 * yy +- */ +- +- quadMatrix->xx = 1.0f / glowSize; +- quadMatrix->yy = -1.0f / glowSize; +- quadMatrix->x0 = -(x1 * quadMatrix->xx); +- quadMatrix->y0 = 1.0f - (y1 * quadMatrix->yy); +- +- y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset, +- WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2)); +- x2 = MIN (WIN_REAL_X (w) + glowOffset, +- WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2)); +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Bottom right corner */ +- box = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mBox; +- mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix; +- +- x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset; +- y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset; +- x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset; +- y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * Scaling the both parts of the texture in a negative direction +- * (right to left bottom to top) +- * +- * The base position (x0 and y0) here requires us to move forwards +- * on both dimentions by the calculated rect dimentions +- * multiplied by the scale factors +- */ +- +- quadMatrix->xx = -1.0f / glowSize; +- quadMatrix->yy = -1.0f / glowSize; +- quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx); +- quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy); +- +- x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset, +- WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2)); +- y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset, +- WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2)); +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Top edge */ +- box = &mGlowQuads[GLOWQUAD_TOP].mBox; +- mGlowQuads[GLOWQUAD_TOP].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_TOP].mMatrix; +- +- x1 = WIN_REAL_X (w) + glowOffset; +- y1 = WIN_REAL_Y (w) - glowSize + glowOffset; +- x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset; +- y2 = WIN_REAL_Y (w) + glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * No need to scale the x part of the texture here, but we +- * are scaling on the y part in a positive direciton +- * +- * The base position (y0) here requires us to move backwards +- * on the x dimention and forwards on y by the calculated rect dimentions +- * multiplied by the scale factors +- */ +- +- quadMatrix->xx = 0.0f; +- quadMatrix->yy = 1.0f / glowSize; +- quadMatrix->x0 = 1.0; +- quadMatrix->y0 = -(y1 * quadMatrix->yy); +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Bottom edge */ +- box = &mGlowQuads[GLOWQUAD_BOTTOM].mBox; +- mGlowQuads[GLOWQUAD_BOTTOM].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOM].mMatrix; +- +- x1 = WIN_REAL_X (w) + glowOffset; +- y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset; +- x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset; +- y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * No need to scale the x part of the texture here, but we +- * are scaling on the y part in a negative direciton +- * +- * The base position (y0) here requires us to move forwards +- * on y by the calculated rect dimentions +- * multiplied by the scale factors +- */ +- +- quadMatrix->xx = 0.0f; +- quadMatrix->yy = -1.0f / glowSize; +- quadMatrix->x0 = 1.0; +- quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy); +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Left edge */ +- box = &mGlowQuads[GLOWQUAD_LEFT].mBox; +- mGlowQuads[GLOWQUAD_LEFT].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_LEFT].mMatrix; +- +- x1 = WIN_REAL_X (w) - glowSize + glowOffset; +- y1 = WIN_REAL_Y (w) + glowOffset; +- x2 = WIN_REAL_X (w) + glowOffset; +- y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * No need to scale the y part of the texture here, but we +- * are scaling on the x part in a positive direciton +- * +- * The base position (x0) here requires us to move backwards +- * on x by the calculated rect dimentions +- * multiplied by the scale factors +- */ +- +- quadMatrix->xx = 1.0f / glowSize; +- quadMatrix->yy = 0.0f; +- quadMatrix->x0 = -(x1 * quadMatrix->xx); +- quadMatrix->y0 = 1.0; +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +- +- /* Right edge */ +- box = &mGlowQuads[GLOWQUAD_RIGHT].mBox; +- mGlowQuads[GLOWQUAD_RIGHT].mMatrix = *matrix; +- quadMatrix = &mGlowQuads[GLOWQUAD_RIGHT].mMatrix; +- +- x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset; +- y1 = WIN_REAL_Y (w) + glowOffset; +- x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset; +- y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset; +- +- /* 2x2 Matrix here, adjust both x and y scale factors +- * and the x and y position +- * +- * No need to scale the y part of the texture here, but we +- * are scaling on the x part in a negative direciton +- * +- * The base position (x0) here requires us to move forwards +- * on x by the calculated rect dimentions +- * multiplied by the scale factors +- */ +- +- quadMatrix->xx = -1.0f / glowSize; +- quadMatrix->yy = 0.0f; +- quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx); +- quadMatrix->y0 = 1.0; +- +- *box = CompRect (x1, y1, x2 - x1, y2 - y1); +-} +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/glow.h compiz-plugins-main-gles2/glow.h +--- compiz-plugins-main-package/glow.h 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/glow.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,66 +0,0 @@ +-/** +- * +- * Compiz group plugin +- * +- * glow.h +- * +- * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen, +- * Danny Baumann, Sam Spilsbury +- * Authors: Patrick Niklaus +- * Roi Cohen +- * Danny Baumann +- * Sam Spilsbury +- * +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * as published by the Free Software Foundation; either version 2 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- **/ +- +-#ifndef _EXPO_GLOW_H +-#define _EXPO_GLOW_H +- +-#define GLOWQUAD_TOPLEFT 0 +-#define GLOWQUAD_TOPRIGHT 1 +-#define GLOWQUAD_BOTTOMLEFT 2 +-#define GLOWQUAD_BOTTOMRIGHT 3 +-#define GLOWQUAD_TOP 4 +-#define GLOWQUAD_BOTTOM 5 +-#define GLOWQUAD_LEFT 6 +-#define GLOWQUAD_RIGHT 7 +-#define NUM_GLOWQUADS 8 +- +-/* Represents a particular glow texture, so here +- * we have hardcoded in the texture data, the offset +- * and the size of the texture +- */ +- +-typedef struct _GlowTextureProperties { +- char *textureData; +- int textureSize; +- int glowOffset; +-} GlowTextureProperties; +- +-/* Each glow quad contains a 2x2 scale + positional matrix +- * (the 3rd column is not used since that is for matrix skew +- * operations which we do not care about) +- * and also a CompRect which describes the size and position of +- * the quad on the glow +- */ +- +-class GlowQuad { +- public: +- CompRect mBox; +- GLTexture::Matrix mMatrix; +-}; +- +-extern const GlowTextureProperties glowTextureProperties; +- +-#endif +diff -Nur '--exclude=.*' '--exclude=debian' compiz-plugins-main-package/grid/grid.xml.in compiz-plugins-main-gles2/grid/grid.xml.in +--- compiz-plugins-main-package/grid/grid.xml.in 2012-04-05 12:28:43.684442000 +0200 ++++ compiz-plugins-main-gles2/grid/grid.xml.in 2012-04-05 12:29:41.374453000 +0200 +@@ -23,16 +23,17 @@ + + + + +