summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Watkins <travis.watkins@linaro.org>2011-05-19 09:43:17 -0500
committerTravis Watkins <travis.watkins@linaro.org>2011-05-19 09:43:17 -0500
commit633fd71225900cc4b281899ced93d4a73509be05 (patch)
tree935ebf2ea759039205e0e56a34bb30c886b860cb
parent53f984e74cddba74fc5068e7620dd066637197fa (diff)
downloadworkarounds-633fd71225900cc4b281899ced93d4a73509be05.tar.gz
workarounds-633fd71225900cc4b281899ced93d4a73509be05.tar.bz2
initial GLES port
-rw-r--r--src/workarounds.cpp14
-rw-r--r--src/workarounds.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/workarounds.cpp b/src/workarounds.cpp
index 7911cd8..747b8df 100644
--- a/src/workarounds.cpp
+++ b/src/workarounds.cpp
@@ -373,6 +373,7 @@ WorkaroundsScreen::removeFromFullscreenList (CompWindow *w)
mfwList.remove (w->id ());
}
+#ifndef USE_GLES
static void
workaroundsProgramEnvParameter4f (GLenum target,
GLuint index,
@@ -393,21 +394,25 @@ workaroundsProgramEnvParameter4f (GLenum target,
(*ws->programEnvParameter4dv) (target, index, data);
}
+#endif
void
WorkaroundsScreen::updateParameterFix ()
{
+#ifndef USE_GLES
if (!GL::programEnvParameter4f || !programEnvParameter4dv)
return;
if (optionGetAiglxFragmentFix ())
GL::programEnvParameter4f = workaroundsProgramEnvParameter4f;
else
GL::programEnvParameter4f = origProgramEnvParameter4f;
+#endif
}
void
WorkaroundsScreen::updateVideoSyncFix ()
{
+#ifndef USE_GLES
if ((!GL::getVideoSync || origGetVideoSync) ||
(!GL::waitVideoSync || origWaitVideoSync))
return;
@@ -421,6 +426,7 @@ WorkaroundsScreen::updateVideoSyncFix ()
GL::getVideoSync = origGetVideoSync;
GL::waitVideoSync = origWaitVideoSync;
}
+#endif
}
void
@@ -439,8 +445,10 @@ WorkaroundsScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
CompOutput *output,
unsigned int mask)
{
+#ifndef USE_GLES
if (optionGetForceGlxSync ())
glXWaitX ();
+#endif
return gScreen->glPaintOutput (attrib, transform, region, output, mask);
}
@@ -822,6 +830,7 @@ WorkaroundsScreen::optionChanged (CompOption *opt,
foreach (CompWindow *w, screen->windows ())
WorkaroundsWindow::get (w)->updateSticky ();
+#ifndef USE_GLES
if (haveOpenGL)
{
updateParameterFix ();
@@ -832,6 +841,7 @@ WorkaroundsScreen::optionChanged (CompOption *opt,
else
GL::copySubBuffer = origCopySubBuffer;
}
+#endif
if (optionGetKeepMinimizedWindows ())
{
@@ -1052,6 +1062,7 @@ WorkaroundsScreen::WorkaroundsScreen (CompScreen *screen) :
&WorkaroundsScreen::optionChanged, this,
_1, _2));
+#ifndef USE_GLES
if (haveOpenGL)
{
origProgramEnvParameter4f = GL::programEnvParameter4f;
@@ -1068,18 +1079,21 @@ WorkaroundsScreen::WorkaroundsScreen (CompScreen *screen) :
if (optionGetFglrxXglFix () && haveOpenGL)
GL::copySubBuffer = NULL;
+#endif
checkFunctions (false, true);
}
WorkaroundsScreen::~WorkaroundsScreen ()
{
+#ifndef USE_GLES
if (haveOpenGL)
{
GL::copySubBuffer = origCopySubBuffer;
GL::getVideoSync = origGetVideoSync;
GL::waitVideoSync = origWaitVideoSync;
}
+#endif
}
WorkaroundsWindow::WorkaroundsWindow (CompWindow *window) :
diff --git a/src/workarounds.h b/src/workarounds.h
index 9665fc2..9ae93c7 100644
--- a/src/workarounds.h
+++ b/src/workarounds.h
@@ -39,9 +39,11 @@
extern bool haveOpenGL;
+#ifndef USE_GLES
typedef void (*GLProgramParameter4dvProc) (GLenum target,
GLuint index,
const GLdouble *data);
+#endif
class WorkaroundsScreen :
public PluginClassHandler <WorkaroundsScreen, CompScreen>,
@@ -65,6 +67,7 @@ class WorkaroundsScreen :
PropertyWriter inputDisabledAtom;
+#ifndef USE_GLES
GL::GLProgramParameter4fProc origProgramEnvParameter4f;
GLProgramParameter4dvProc programEnvParameter4dv;
@@ -72,6 +75,7 @@ class WorkaroundsScreen :
GL::GLXWaitVideoSyncProc origWaitVideoSync;
GL::GLXCopySubBufferProc origCopySubBuffer;
+#endif
void
handleEvent (XEvent *);