summaryrefslogtreecommitdiff
diff options
authorMarc Ordinas i Llopis <marc.ordinasillopis@linaro.org>2012-01-20 17:32:55 +0100
committerMarc Ordinas i Llopis <marc.ordinasillopis@linaro.org>2012-01-20 17:32:55 +0100
commit3b4bf01398e7bd0648314db5fa8c7d50da152ded (patch)
tree14669bb5112029df99816eff0f968f59f5bdebbe
parent442d130139ec20765a6b72a5b03f931f2d997337 (diff)
GLES2: Make GLES2 build compile.
(bzr r1826.3.5)
-rw-r--r--plugins/unitydialog/src/unitydialog.cpp2
-rw-r--r--plugins/unityshell/src/ScreenEffectFramebufferObject.cpp4
-rw-r--r--plugins/unityshell/src/ScreenEffectFramebufferObject.h2
-rw-r--r--plugins/unityshell/src/unityshell.cpp16
-rw-r--r--plugins/unityshell/src/unityshell.h12
5 files changed, 35 insertions, 1 deletions
diff --git a/plugins/unitydialog/src/unitydialog.cpp b/plugins/unitydialog/src/unitydialog.cpp
index b13a6f3be..300b8e19f 100644
--- a/plugins/unitydialog/src/unitydialog.cpp
+++ b/plugins/unitydialog/src/unitydialog.cpp
@@ -661,7 +661,7 @@ UnityDialogWindow::glDraw(const GLMatrix& transform,
* dim render on top */
bool status = gWindow->glDraw(transform,
#ifdef USE_GLES
- attrib
+ attrib,
#else
fragment,
#endif
diff --git a/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp b/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
index 6b0011f38..2f2010396 100644
--- a/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
+++ b/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
@@ -17,6 +17,7 @@
* Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
*/
+#ifndef USE_GLES
#include "ScreenEffectFramebufferObject.h"
#include "BackgroundEffectHelper.h"
#include <NuxCore/Logger.h>
@@ -232,3 +233,6 @@ unity::ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject ()
if (mFBTexture)
glDeleteTextures (1, &mFBTexture);
}
+
+#endif // USE_GLES
+
diff --git a/plugins/unityshell/src/ScreenEffectFramebufferObject.h b/plugins/unityshell/src/ScreenEffectFramebufferObject.h
index 1dbecca0e..2481136f1 100644
--- a/plugins/unityshell/src/ScreenEffectFramebufferObject.h
+++ b/plugins/unityshell/src/ScreenEffectFramebufferObject.h
@@ -20,6 +20,7 @@
#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
+#ifndef USE_GLES
#include <Nux/Nux.h>
namespace unity
@@ -84,4 +85,5 @@ private:
};
} // namespace unity
+#endif // USE_GLES
#endif
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 3ac3cff3c..22bda9088 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -113,7 +113,9 @@ UnityScreen::UnityScreen(CompScreen* screen)
, damaged(false)
, _key_nav_mode_requested(false)
, _last_output(nullptr)
+#ifndef USE_GLES
, _active_fbo (0)
+#endif
, dash_is_open_ (false)
, grab_index_ (0)
, painting_tray_ (false)
@@ -669,7 +671,11 @@ UnityWindow::updateIconPos (int &wx,
wy = y + (last_bound.height - height) / 2;
}
+#ifdef USE_GLES
+void UnityScreen::paintDisplay()
+#else
void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask)
+#endif
{
CompOutput *output = _last_output;
Window tray_xid = panel_controller_->GetTrayXid ();
@@ -733,7 +739,9 @@ void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transfo
#endif
unsigned int oldGlAddGeometryIndex = uTrayWindow->gWindow->glAddGeometryGetCurrentIndex ();
unsigned int oldGlDrawIndex = uTrayWindow->gWindow->glDrawGetCurrentIndex ();
+#ifndef USE_GLES
unsigned int oldGlDrawGeometryIndex = uTrayWindow->gWindow->glDrawGeometryGetCurrentIndex ();
+#endif
#ifndef USE_GLES
attrib.setOpacity (OPAQUE);
@@ -757,12 +765,16 @@ void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transfo
/* force the use of the core functions */
uTrayWindow->gWindow->glDrawSetCurrentIndex (MAXSHORT);
uTrayWindow->gWindow->glAddGeometrySetCurrentIndex ( MAXSHORT);
+#ifndef USE_GLES
uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (MAXSHORT);
+#endif
uTrayWindow->gWindow->glDraw (oTransform, attrib, infiniteRegion,
PAINT_WINDOW_TRANSFORMED_MASK |
PAINT_WINDOW_BLEND_MASK |
PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK);
+#ifndef USE_GLES
uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (oldGlDrawGeometryIndex);
+#endif
uTrayWindow->gWindow->glAddGeometrySetCurrentIndex (oldGlAddGeometryIndex);
uTrayWindow->gWindow->glDrawSetCurrentIndex (oldGlDrawIndex);
painting_tray_ = false;
@@ -1891,7 +1903,11 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
{
if (xwns[i] == id)
{
+#ifdef USE_GLES
+ uScreen->paintDisplay();
+#else
uScreen->paintDisplay(region, matrix, mask);
+#endif
break;
}
}
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index cb9631cb2..6c047e24d 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -47,7 +47,9 @@
#include "DebugDBusInterface.h"
#include "SwitcherController.h"
#include "UBusWrapper.h"
+#ifndef USE_GLES
#include "ScreenEffectFramebufferObject.h"
+#endif
#include "compizminimizedwindowhandler.h"
#include "BGHash.h"
@@ -128,7 +130,11 @@ public:
void nuxEpilogue();
/* nux draw wrapper */
+#ifdef USE_GLES
+ void paintDisplay();
+#else
void paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask);
+#endif
void paintPanelShadow(const GLMatrix& matrix);
void preparePaint (int ms);
@@ -295,8 +301,12 @@ private:
unity::BGHash _bghash;
+#ifdef USE_GLES
+ GLFramebufferObject *oldFbo;
+#else
ScreenEffectFramebufferObject::Ptr _fbo;
GLuint _active_fbo;
+#endif
bool queryForShader ();
@@ -307,7 +317,9 @@ private:
bool painting_tray_;
unsigned int tray_paint_mask_;
+#ifndef USE_GLES
ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP;
+#endif
friend class UnityWindow;
};