summaryrefslogtreecommitdiff
path: root/plugins/unity-mt-grab-handles
diff options
authorMarc Ordinas i Llopis <marc.ordinasillopis@linaro.org>2012-01-19 19:36:58 +0100
committerMarc Ordinas i Llopis <marc.ordinasillopis@linaro.org>2012-01-19 19:36:58 +0100
commit0d86a80038208dd52345fc0c4983e4500ebf51ed (patch)
tree53fb6137b8d1f6e9002ece58eabfa6b8a060a070 /plugins/unity-mt-grab-handles
parented2717489793e79f8aeb4f6efe1ee2e0e9a01971 (diff)
GLES2: Ported changes to files outside plugins/unityshell.
(bzr r1826.3.1)
Diffstat (limited to 'plugins/unity-mt-grab-handles')
-rw-r--r--plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp31
-rw-r--r--plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h4
2 files changed, 33 insertions, 2 deletions
diff --git a/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp b/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp
index ce5792da1..db43d7473 100644
--- a/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp
+++ b/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp
@@ -438,13 +438,21 @@ UnityMTGrabHandlesWindow::getOutputExtents(CompWindowExtents& output)
bool
UnityMTGrabHandlesWindow::glDraw(const GLMatrix& transform,
+#ifdef USE_GLES
+ GLWindowPaintAttrib& attrib,
+#else
GLFragment::Attrib& fragment,
+#endif
const CompRegion& region,
unsigned int mask)
{
/* Draw the window on the bottom, we will be drawing the
* handles on top */
+#ifdef USE_GLES
+ bool status = gWindow->glDraw(transform, attrib, region, mask);
+#else
bool status = gWindow->glDraw(transform, fragment, region, mask);
+#endif
if (mHandles && mHandles->visible())
{
@@ -464,10 +472,17 @@ UnityMTGrabHandlesWindow::glDraw(const GLMatrix& transform,
GLTexture::MatrixList matl;
GLTexture::Matrix mat = tex->matrix();
CompRegion paintRegion(region);
+#ifdef USE_GLES
+ GLWindowPaintAttrib wAttrib(attrib);
+#endif
/* We can reset the window geometry since it will be
* re-added later */
+#ifdef USE_GLES
+ gWindow->vertexBuffer()->begin();
+#else
gWindow->geometry().reset();
+#endif
/* Not sure what this does, but it is necessary
* (adjusts for scale?) */
@@ -483,23 +498,35 @@ UnityMTGrabHandlesWindow::glDraw(const GLMatrix& transform,
* dim (so we get a nice render for things like
* wobbly etc etc */
gWindow->glAddGeometry(matl, reg, paintRegion);
-
+#ifdef USE_GLES
+ gWindow->vertexBuffer()->end();
+ wAttrib.opacity = mHandles->opacity();
+#else
/* Did it succeed? */
if (gWindow->geometry().vertices)
{
fragment.setOpacity(mHandles->opacity());
+#endif
/* Texture rendering set-up */
us->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->glDrawTexture(tex, fragment, mask | PAINT_WINDOW_BLEND_MASK
+ gWindow->glDrawTexture(tex,
+#ifdef USE_GLES
+ transform, wAttrib,
+#else
+ fragment,
+#endif
+ mask | PAINT_WINDOW_BLEND_MASK
| PAINT_WINDOW_TRANSLUCENT_MASK |
PAINT_WINDOW_TRANSFORMED_MASK);
/* Texture rendering tear-down */
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
us->gScreen->setTexEnvMode(GL_REPLACE);
+#ifndef USE_GLES
}
+#endif
}
handle++;
diff --git a/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h b/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h
index e10568ce0..a5a4e362e 100644
--- a/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h
+++ b/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h
@@ -229,7 +229,11 @@ public:
void moveNotify(int dx, int dy, bool immediate);
bool glDraw(const GLMatrix&,
+#ifdef USE_GLES
+ const GLWindowPaintAttrib&,
+#else
GLFragment::Attrib&,
+#endif
const CompRegion&,
unsigned int);