summaryrefslogtreecommitdiff
diff options
-rw-r--r--CMakeLists.txt2
-rw-r--r--plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp39
-rw-r--r--plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h4
-rw-r--r--plugins/unitydialog/src/unitydialog.cpp131
-rw-r--r--plugins/unitydialog/src/unitydialog.h20
-rw-r--r--plugins/unityshell/src/ScreenEffectFramebufferObject.cpp243
-rw-r--r--plugins/unityshell/src/ScreenEffectFramebufferObject.h89
-rw-r--r--plugins/unityshell/src/unityshell.cpp316
-rw-r--r--plugins/unityshell/src/unityshell.h20
9 files changed, 36 insertions, 828 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06d72508d..17b4d71ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,7 +127,7 @@ endif (DISABLE_MAINTAINER_CFLAGS)
#
# Compiz Plugins
#
-set (UNITY_PLUGIN_DEPS "compiz;nux-3.0>=3.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;gmodule-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;unity-misc>=0.4.0;dbus-glib-1;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;xfixes;unity-protocol-private>=5.95.1;libgeis;xrender>=0.9")
+set (UNITY_PLUGIN_DEPS "compiz>=0.9.8.0;nux-3.0>=3.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;gmodule-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;unity-misc>=0.4.0;dbus-glib-1;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;xfixes;unity-protocol-private>=5.95.1;libgeis;xrender>=0.9")
set (UNITY_PROTOCOL_PRIVATE_DEPS "unity-protocol-private>=5.95.1")
find_package (PkgConfig)
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 8807ebc14..e16cb89c3 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,29 +438,19 @@ UnityMTGrabHandlesWindow::getOutputExtents(CompWindowExtents& output)
bool
UnityMTGrabHandlesWindow::glDraw(const GLMatrix& transform,
-#ifdef USE_MODERN_COMPIZ_GL
const 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_MODERN_COMPIZ_GL
bool status = gWindow->glDraw(transform, attrib, region, mask);
-#else
- bool status = gWindow->glDraw(transform, fragment, region, mask);
-#endif
if (mHandles && mHandles->visible())
{
unsigned int allowedHandles = unity::MT::getLayoutForMask (window->state (), window->actions ());
unsigned int handle = 0;
- UMTGH_SCREEN (screen);
-
for(unity::MT::TextureLayout layout : mHandles->layout (allowedHandles))
{
/* We want to set the geometry of the handle to the window
@@ -472,17 +462,11 @@ UnityMTGrabHandlesWindow::glDraw(const GLMatrix& transform,
GLTexture::MatrixList matl;
GLTexture::Matrix mat = tex->matrix();
CompRegion paintRegion(region);
-#ifdef USE_MODERN_COMPIZ_GL
GLWindowPaintAttrib wAttrib(attrib);
-#endif
/* We can reset the window geometry since it will be
* re-added later */
-#ifdef USE_MODERN_COMPIZ_GL
gWindow->vertexBuffer()->begin();
-#else
- gWindow->geometry().reset();
-#endif
/* Not sure what this does, but it is necessary
* (adjusts for scale?) */
@@ -498,35 +482,22 @@ 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_MODERN_COMPIZ_GL
- gWindow->vertexBuffer()->end();
- wAttrib.opacity = mHandles->opacity();
-#else
- /* Did it succeed? */
- if (gWindow->geometry().vertices)
- {
- fragment.setOpacity(mHandles->opacity());
- /* Texture rendering set-up */
- us->gScreen->setTexEnvMode(GL_MODULATE);
-#endif
+
+ if (gWindow->vertexBuffer()->end())
+ {
+ wAttrib.opacity = mHandles->opacity();
+
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
/* Draw the dim texture with all of it's modified
* geometry glory */
gWindow->glDrawTexture(tex,
-#ifdef USE_MODERN_COMPIZ_GL
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);
-#ifndef USE_MODERN_COMPIZ_GL
- us->gScreen->setTexEnvMode(GL_REPLACE);
}
-#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 9cd99b9d1..f0d3776e5 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,11 +229,7 @@ public:
void moveNotify(int dx, int dy, bool immediate);
bool glDraw(const GLMatrix&,
-#ifdef USE_MODERN_COMPIZ_GL
const GLWindowPaintAttrib&,
-#else
- GLFragment::Attrib&,
-#endif
const CompRegion&,
unsigned int);
diff --git a/plugins/unitydialog/src/unitydialog.cpp b/plugins/unitydialog/src/unitydialog.cpp
index 91f7f235e..3951b65f7 100644
--- a/plugins/unitydialog/src/unitydialog.cpp
+++ b/plugins/unitydialog/src/unitydialog.cpp
@@ -420,12 +420,8 @@ UnityDialogWindow::glAddGeometry(const GLTexture::MatrixList& matrices,
/* Collect textures */
void
UnityDialogWindow::glDrawTexture(GLTexture* texture,
-#ifdef USE_MODERN_COMPIZ_GL
const GLMatrix &transform,
const GLWindowPaintAttrib &attrib,
-#else
- GLFragment::Attrib& fa,
-#endif
unsigned int mask)
{
unity::PaintInfoCollector::Active ()->processTexture (texture);
@@ -448,16 +444,12 @@ unity::GeometryCollection::status ()
collectedMinVertices.size () == collectedMatrixLists.size ());
}
-void
+bool
unity::GeometryCollection::addGeometryForWindow (CompWindow *w, const CompRegion &paintRegion)
{
/* We can reset the window geometry since it will be
* re-added later */
-#ifdef USE_MODERN_COMPIZ_GL
GLWindow::get (w)->vertexBuffer()->begin();
-#else
- GLWindow::get (w)->geometry().reset();
-#endif
for (unsigned int i = 0; i < collectedMatrixLists.size (); i++)
{
@@ -472,9 +464,7 @@ unity::GeometryCollection::addGeometryForWindow (CompWindow *w, const CompRegion
GLWindow::get (w)->glAddGeometry(matl, reg, paintRegion, min, max);
}
-#ifdef USE_MODERN_COMPIZ_GL
- GLWindow::get (w)->vertexBuffer()->end();
-#endif
+ return GLWindow::get (w)->vertexBuffer()->end();
}
void
@@ -511,9 +501,7 @@ unity::TexGeometryCollection::setTexture (GLTexture *tex)
void
unity::TexGeometryCollection::addGeometriesAndDrawTextureForWindow(CompWindow *w,
-#ifdef USE_MODERN_COMPIZ_GL
const GLMatrix &transform,
-#endif
unsigned int mask)
{
if (mTexture && mGeometries.status ())
@@ -524,47 +512,25 @@ unity::TexGeometryCollection::addGeometriesAndDrawTextureForWindow(CompWindow *w
if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
paintRegion = infiniteRegion;
- mGeometries.addGeometryForWindow (w, paintRegion);
-
-#ifdef USE_MODERN_COMPIZ_GL
- UnityDialogScreen *uds = UnityDialogScreen::get (screen);
- GLWindowPaintAttrib attrib (gWindow->lastPaintAttrib());
- unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
- /* Texture rendering set-up */
-// uds->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(mTexture, transform, attrib, 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);
- uds->gScreen->setTexEnvMode(GL_REPLACE);
-#else
- if (gWindow->geometry().vertices)
+ if (mGeometries.addGeometryForWindow (w, paintRegion))
{
- UnityDialogScreen *uds = UnityDialogScreen::get (screen);
- GLFragment::Attrib fa (gWindow->lastPaintAttrib());
- unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
- /* Texture rendering set-up */
- uds->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(mTexture, 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);
- uds->gScreen->setTexEnvMode(GL_REPLACE);
+ UnityDialogScreen *uds = UnityDialogScreen::get (screen);
+ GLWindowPaintAttrib attrib (gWindow->lastPaintAttrib());
+ unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
+ /* Texture rendering set-up */
+ 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(mTexture, transform, attrib, 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);
+ uds->gScreen->setTexEnvMode(GL_REPLACE);
}
-#endif
}
}
@@ -619,17 +585,11 @@ unity::PaintInfoCollector::processTexture (GLTexture *tex)
void
unity::PaintInfoCollector::drawGeometriesForWindow(CompWindow *w,
-#ifdef USE_MODERN_COMPIZ_GL
const GLMatrix &transform,
-#endif
unsigned int pm)
{
for (unity::TexGeometryCollection &tcg : mCollection)
-#if USE_MODERN_COMPIZ_GL
tcg.addGeometriesAndDrawTextureForWindow (w, transform, pm);
-#else
- tcg.addGeometriesAndDrawTextureForWindow (w, pm);
-#endif
}
unity::PaintInfoCollector * unity::PaintInfoCollector::active_collector = NULL;
@@ -644,11 +604,7 @@ unity::PaintInfoCollector::Active ()
bool
UnityDialogWindow::glDraw(const GLMatrix& transform,
-#ifdef USE_MODERN_COMPIZ_GL
const GLWindowPaintAttrib& attrib,
-#else
- GLFragment::Attrib& fragment,
-#endif
const CompRegion& region,
unsigned int mask)
{
@@ -660,11 +616,7 @@ UnityDialogWindow::glDraw(const GLMatrix& transform,
/* Draw the window on the bottom, we will be drawing the
* dim render on top */
bool status = gWindow->glDraw(transform,
-#ifdef USE_MODERN_COMPIZ_GL
attrib,
-#else
- fragment,
-#endif
region, mask);
UNITY_DIALOG_SCREEN(screen);
@@ -673,17 +625,11 @@ UnityDialogWindow::glDraw(const GLMatrix& transform,
{
GLTexture::MatrixList matl;
GLTexture::Matrix mat = tex->matrix();
-#ifdef USE_MODERN_COMPIZ_GL
GLWindowPaintAttrib wAttrib(attrib);
-#endif
/* We can reset the window geometry since it will be
* re-added later */
-#ifdef USE_MODERN_COMPIZ_GL
gWindow->vertexBuffer()->begin();
-#else
- gWindow->geometry().reset();
-#endif
/* Scale the dim render by the ratio of dim size
* to window size */
@@ -704,48 +650,25 @@ UnityDialogWindow::glDraw(const GLMatrix& transform,
* dim (so we get a nice render for things like
* wobbly etc etc */
gWindow->glAddGeometry(matl, reg, paintRegion);
-#ifdef USE_MODERN_COMPIZ_GL
- gWindow->vertexBuffer()->end();
-#endif
-
-#ifdef USE_MODERN_COMPIZ_GL
- unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
- wAttrib.opacity = mShadeProgress;
- /* Texture rendering set-up */
-// uds->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, attrib, 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);
- uds->gScreen->setTexEnvMode(GL_REPLACE);
-#else
- /* Did it succeed? */
- if (gWindow->geometry().vertices)
+ if (gWindow->vertexBuffer()->end())
{
unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
- fragment.setOpacity(mShadeProgress);
+ wAttrib.opacity = mShadeProgress;
/* Texture rendering set-up */
- uds->gScreen->setTexEnvMode(GL_MODULATE);
+ // uds->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, fragment, mask | PAINT_WINDOW_BLEND_MASK
- | PAINT_WINDOW_TRANSLUCENT_MASK |
- PAINT_WINDOW_TRANSFORMED_MASK);
+ gWindow->glDrawTexture(tex, transform, attrib, 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);
uds->gScreen->setTexEnvMode(GL_REPLACE);
}
-#endif
}
for (CompWindow* w : mTransients)
@@ -759,9 +682,7 @@ UnityDialogWindow::glDraw(const GLMatrix& transform,
pc.collect();
pc.drawGeometriesForWindow (window,
-#ifdef USE_MODERN_COMPIZ_GL
transform,
-#endif
mask);
}
}
diff --git a/plugins/unitydialog/src/unitydialog.h b/plugins/unitydialog/src/unitydialog.h
index eee9adea7..4f3f26338 100644
--- a/plugins/unitydialog/src/unitydialog.h
+++ b/plugins/unitydialog/src/unitydialog.h
@@ -40,7 +40,7 @@ namespace unity
GeometryCollection ();
bool status ();
- void addGeometryForWindow (CompWindow *, const CompRegion &paintRegion);
+ bool addGeometryForWindow (CompWindow *, const CompRegion &paintRegion);
void addGeometry (const GLTexture::MatrixList &ml,
const CompRegion &r,
int min,
@@ -64,13 +64,9 @@ namespace unity
int max);
void setTexture (GLTexture *);
-#ifdef USE_MODERN_COMPIZ_GL
void addGeometriesAndDrawTextureForWindow (CompWindow *w,
const GLMatrix &transform,
- unsigned int mask);
-#else
- void addGeometriesAndDrawTextureForWindow (CompWindow *, unsigned int pm);
-#endif
+ unsigned int mask);
private:
GLTexture* mTexture;
@@ -84,13 +80,9 @@ namespace unity
PaintInfoCollector (CompWindow *w);
void collect ();
-#ifdef USE_MODERN_COMPIZ_GL
void drawGeometriesForWindow (CompWindow *w,
const GLMatrix &transform,
unsigned int pm);
-#else
- void drawGeometriesForWindow (CompWindow *w, unsigned int pm);
-#endif
void processGeometry (const GLTexture::MatrixList &ml,
const CompRegion &r,
@@ -255,11 +247,7 @@ public:
bool
glDraw(const GLMatrix&,
-#ifdef USE_MODERN_COMPIZ_GL
const GLWindowPaintAttrib&,
-#else
- GLFragment::Attrib&,
-#endif
const CompRegion&, unsigned int);
bool
@@ -275,12 +263,8 @@ public:
void
glDrawTexture(GLTexture* texture,
-#ifdef USE_MODERN_COMPIZ_GL
const GLMatrix& transform,
const GLWindowPaintAttrib& attrib,
-#else
- GLFragment::Attrib& attrib,
-#endif
unsigned int mask);
diff --git a/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp b/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
deleted file mode 100644
index de9be43f3..000000000
--- a/plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
-/* Compiz unity plugin
- * unity.h
- *
- * Copyright (c) 2010-11 Canonical Ltd.
- *
- * 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 3
- * 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.
- *
- * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
- */
-
-#ifndef USE_GLES
-#include "ScreenEffectFramebufferObject.h"
-#include "BackgroundEffectHelper.h"
-#include <NuxCore/Logger.h>
-#include <dlfcn.h>
-
-namespace
-{
- nux::logging::Logger logger ("unity.screeneffectframebufferobject");
-}
-
-void unity::ScreenEffectFramebufferObject::paint (const nux::Geometry &output)
-{
- /* Draw the bit of the relevant framebuffer for each output */
-
- glPushAttrib (GL_VIEWPORT_BIT);
- glViewport (0, 0, mScreenSize.width, mScreenSize.height);
-
- if (mFBTexture)
- {
- glEnable (GL_TEXTURE_2D);
- activeTexture (GL_TEXTURE0_ARB);
- glBindTexture (GL_TEXTURE_2D, mFBTexture);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glPushAttrib (GL_SCISSOR_BIT);
- glEnable (GL_SCISSOR_TEST);
-
- glScissor (output.x, mScreenSize.height - (output.y + output.height),
- output.width, output.height);
-
- /* FIXME: This needs to be GL_TRIANGLE_STRIP */
- glBegin (GL_QUADS);
- glTexCoord2f (0, 1);
- glVertex2i (mGeometry.x, mGeometry.y);
- glTexCoord2f (0, 0);
- glVertex2i (mGeometry.x, mGeometry.y + mGeometry.height);
- glTexCoord2f (1, 0);
- glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y + mGeometry.height);
- glTexCoord2f (1, 1);
- glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y);
- glEnd ();
-
- activeTexture (GL_TEXTURE0_ARB);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glBindTexture (GL_TEXTURE_2D, 0);
- glDisable (GL_TEXTURE_2D);
- glPopAttrib ();
- }
- glPopAttrib ();
-}
-
-void unity::ScreenEffectFramebufferObject::onScreenSizeChanged(const nux::Geometry& screenSize)
-{
- mScreenSize = screenSize;
-}
-
-
-void unity::ScreenEffectFramebufferObject::unbind ()
-{
- if (!mBoundCnt)
- return;
-
- mBoundCnt--;
-
- (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, 0);
-
- glDrawBuffer (GL_BACK);
- glReadBuffer (GL_BACK);
-
- /* Matches the viewport set we did in ::bind () */
- glPopAttrib ();
-
-}
-
-bool unity::ScreenEffectFramebufferObject::status ()
-{
- return mFboStatus;
-}
-
-void unity::ScreenEffectFramebufferObject::bind (const nux::Geometry &output)
-{
- /* Very important!
- * Don't bind unless BackgroundEffectHelper says it's necessary.
- * Because binding has a severe impact on graphics performance and we
- * can't afford to do it every frame. (LP: #861061) (LP: #987304)
- */
- if (!BackgroundEffectHelper::HasDirtyHelpers())
- return;
-
- /* Clear the error bit */
- glGetError ();
-
- if (!mFBTexture)
- {
- glGenTextures (1, &mFBTexture);
-
- glBindTexture (GL_TEXTURE_2D, mFBTexture);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, mGeometry.width, mGeometry.height, 0, GL_BGRA,
-#if IMAGE_BYTE_ORDER == MSBFirst
- GL_UNSIGNED_INT_8_8_8_8_REV,
-#else
- GL_UNSIGNED_BYTE,
-#endif
- NULL);
-
- glBindTexture (GL_TEXTURE_2D, 0);
-
- if (glGetError () != GL_NO_ERROR)
- {
- mFboHandle = 0;
- mFboStatus = false;
- return;
- }
- }
-
- (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, mFboHandle);
-
- (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
- GL_TEXTURE_2D, mFBTexture, 0);
-
- (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_TEXTURE_2D, 0, 0);
-
- /* Ensure that a framebuffer is actually available */
- if (!mFboStatus)
- {
- GLint status = (*checkFramebufferStatus) (GL_DRAW_FRAMEBUFFER);
-
- if (status != GL_FRAMEBUFFER_COMPLETE)
- {
- switch (status)
- {
- case GL_FRAMEBUFFER_UNDEFINED:
- LOG_WARN (logger) << "no window";
- break;
- case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
- LOG_WARN (logger) << "attachment incomplete";
- break;
- case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
- LOG_WARN (logger) << "no buffers attached to fbo";
- break;
- case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
- LOG_WARN (logger) << "some attachment in glDrawBuffers doesn't exist in FBO";
- break;
- case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
- LOG_WARN (logger) << "some attachment in glReadBuffers doesn't exist in FBO";
- break;
- case GL_FRAMEBUFFER_UNSUPPORTED:
- LOG_WARN (logger) << "unsupported internal format";
- break;
- case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
- LOG_WARN (logger) << "different levels of sampling for each attachment";
- break;
- case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
- LOG_WARN (logger) << "number of layers is different";
- break;
- default:
- LOG_WARN (logger) << "unable to bind the framebuffer for an unknown reason";
- break;
- }
-
- bindFramebuffer (GL_FRAMEBUFFER_EXT, 0);
- deleteFramebuffers (1, &mFboHandle);
-
- glDrawBuffer (GL_BACK);
- glReadBuffer (GL_BACK);
-
- mFboHandle = 0;
-
- mFboStatus = false;
- }
- else
- mFboStatus = true;
- }
-
- if (mFboStatus)
- {
- glPushAttrib (GL_VIEWPORT_BIT);
-
- glViewport (output.x,
- mScreenSize.height - (output.y + output.height),
- output.width,
- output.height);
- }
-
- mBoundCnt++;
-}
-
-
-unity::ScreenEffectFramebufferObject::ScreenEffectFramebufferObject (GLXGetProcAddressProc p, const nux::Geometry &geom)
- : getProcAddressGLX (p)
- , mFboStatus (false)
- , mFBTexture (0)
- , mGeometry (geom)
- , mBoundCnt (0)
- , mScreenSize (geom)
-{
- activeTexture = (GLActiveTextureProc) (*getProcAddressGLX) ((GLubyte *) "glActiveTexture");
- genFramebuffers = (GLGenFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glGenFramebuffersEXT");
- deleteFramebuffers = (GLDeleteFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glDeleteFramebuffersEXT");
- bindFramebuffer = (GLBindFramebufferProc) (*getProcAddressGLX) ((GLubyte *)"glBindFramebufferEXT");
- checkFramebufferStatus = (GLCheckFramebufferStatusProc) (*getProcAddressGLX) ((GLubyte *) "glCheckFramebufferStatusEXT");
- framebufferTexture2D = (GLFramebufferTexture2DProc) (*getProcAddressGLX) ((GLubyte *) "glFramebufferTexture2DEXT");
-
- (*genFramebuffers) (1, &mFboHandle);
-}
-
-unity::ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject ()
-{
- (*deleteFramebuffers) (1, &mFboHandle);
-
- if (mFBTexture)
- glDeleteTextures (1, &mFBTexture);
-}
-
-#endif // USE_GLES
-
diff --git a/plugins/unityshell/src/ScreenEffectFramebufferObject.h b/plugins/unityshell/src/ScreenEffectFramebufferObject.h
deleted file mode 100644
index 9ccfb9a92..000000000
--- a/plugins/unityshell/src/ScreenEffectFramebufferObject.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
-/* Compiz unity plugin
- * unity.h
- *
- * Copyright (c) 2010-11 Canonical Ltd.
- *
- * 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 3
- * 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.
- *
- * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
- */
-
-#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
-#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
-
-#ifndef USE_MODERN_COMPIZ_GL
-#include <Nux/Nux.h>
-
-namespace unity
-{
-class ScreenEffectFramebufferObject
-{
-public:
-
- typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
- typedef void (*FuncPtr) (void);
- typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
-
- ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
- ~ScreenEffectFramebufferObject ();
-
-public:
-
- void bind (const nux::Geometry &geom);
- void unbind ();
-
- bool status ();
- void paint (const nux::Geometry &geom);
- bool bound () { return mBoundCnt > 0; }
-
- GLuint texture () { return mFBTexture; }
-
- void onScreenSizeChanged (const nux::Geometry &screenSize);
-
-private:
-
- FuncPtr getProcAddr (const std::string &);
-
- typedef void (*GLActiveTextureProc) (GLenum texture);
- typedef void (*GLGenFramebuffersProc) (GLsizei n,
- GLuint *framebuffers);
- typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
- GLuint *framebuffers);
- typedef void (*GLBindFramebufferProc) (GLenum target,
- GLuint framebuffer);
- typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
- typedef void (*GLFramebufferTexture2DProc) (GLenum target,
- GLenum attachment,
- GLenum textarget,
- GLuint texture,
- GLint level);
-
- GLXGetProcAddressProc getProcAddressGLX;
- GLActiveTextureProc activeTexture;
- GLGenFramebuffersProc genFramebuffers;
- GLDeleteFramebuffersProc deleteFramebuffers;
- GLBindFramebufferProc bindFramebuffer;
- GLCheckFramebufferStatusProc checkFramebufferStatus;
- GLFramebufferTexture2DProc framebufferTexture2D;
- /* compiz fbo handle that goes through to nux */
- GLuint mFboHandle; // actual handle to the framebuffer_ext
- bool mFboStatus; // did the framebuffer texture bind succeed
- GLuint mFBTexture;
- nux::Geometry mGeometry;
- unsigned int mBoundCnt;
-
- nux::Geometry mScreenSize;
-};
-} // namespace unity
-
-#endif // USE_MODERN_COMPIZ_GL
-#endif
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 33e8e4e64..81ce97c4b 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -124,9 +124,6 @@ UnityScreen::UnityScreen(CompScreen* screen)
, allowWindowPaint(false)
, _key_nav_mode_requested(false)
, _last_output(nullptr)
-#ifndef USE_MODERN_COMPIZ_GL
- , _active_fbo (0)
-#endif
, grab_index_ (0)
, painting_tray_ (false)
, last_scroll_event_(0)
@@ -250,25 +247,6 @@ UnityScreen::UnityScreen(CompScreen* screen)
uScreen = this;
_in_paint = false;
-#ifndef USE_MODERN_COMPIZ_GL
- void *dlhand = dlopen ("libunityshell.so", RTLD_LAZY);
-
- if (dlhand)
- {
- dlerror ();
- glXGetProcAddressP = (ScreenEffectFramebufferObject::GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress");
- if (dlerror () != NULL)
- glXGetProcAddressP = NULL;
- }
-
- if (GL::fbo)
- {
- nux::Geometry geometry (0, 0, screen->width (), screen->height ());
- uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
- uScreen->_fbo->onScreenSizeChanged (geometry);
- }
-#endif
-
optionSetShowHudInitiate(boost::bind(&UnityScreen::ShowHudInitiate, this, _1, _2, _3));
optionSetShowHudTerminate(boost::bind(&UnityScreen::ShowHudTerminate, this, _1, _2, _3));
optionSetBackgroundColorNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
@@ -506,17 +484,6 @@ void UnityScreen::nuxPrologue()
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
-
-#ifndef USE_MODERN_COMPIZ_GL
- /* This is needed to Fix a crash in glDrawArrays with the NVIDIA driver
- * see bugs #1031554 and #982626.
- * The NVIDIA driver looks to see if the legacy GL_VERTEX_ARRAY,
- * GL_TEXTURE_COORDINATES_ARRAY and other such client states are enabled
- * first before checking if a vertex buffer is bound and will prefer the
- * client buffers over the the vertex buffer object. */
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-#endif
#endif
glGetError();
@@ -525,9 +492,6 @@ void UnityScreen::nuxPrologue()
void UnityScreen::nuxEpilogue()
{
#ifndef USE_GLES
-#ifndef USE_MODERN_COMPIZ_GL
- (*GL::bindFramebuffer)(GL_FRAMEBUFFER_EXT, _active_fbo);
-#endif
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -549,19 +513,9 @@ void UnityScreen::nuxEpilogue()
glPopAttrib();
-#ifndef USE_MODERN_COMPIZ_GL
- /* Re-enable the client states that have been disabled in nuxPrologue, for
- * NVIDIA compatibility reasons */
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-#endif
+ glDepthRange(0, 1);
#else
-#ifdef USE_GLES
glDepthRangef(0, 1);
-#else
- glDepthRange(0, 1);
-#endif
- //glViewport(-1, -1, 2, 2);
gScreen->resetRasterPos();
#endif
@@ -573,86 +527,9 @@ void UnityScreen::setPanelShadowMatrix(const GLMatrix& matrix)
panel_shadow_matrix_ = matrix;
}
+/* Currently unimplemented */
void UnityScreen::paintPanelShadow(const GLMatrix& matrix)
{
-#ifndef USE_MODERN_COMPIZ_GL
- if (sources_.GetSource(local::RELAYOUT_TIMEOUT))
- return;
-
- if (PluginAdapter::Default()->IsExpoActive())
- return;
-
- CompOutput* output = _last_output;
- float vc[4];
- float h = 20.0f;
- float w = 1.0f;
- float panel_h = panel_style_.panel_height;
-
- float x1 = output->x();
- float y1 = output->y() + panel_h;
- float x2 = x1 + output->width();
- float y2 = y1 + h;
-
- glPushMatrix ();
- glLoadMatrixf (panel_shadow_matrix_.getMatrix ());
-
- vc[0] = x1;
- vc[1] = x2;
- vc[2] = y1;
- vc[3] = y2;
-
- // compiz doesn't use the same method of tracking monitors as our toolkit
- // we need to make sure we properly associate with the right monitor
- int current_monitor = -1;
- auto monitors = UScreen::GetDefault()->GetMonitors();
- int i = 0;
- for (auto monitor : monitors)
- {
- if (monitor.x == output->x() && monitor.y == output->y())
- {
- current_monitor = i;
- break;
- }
- i++;
- }
-
- if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)
- && panel_controller_->opacity() > 0.0f)
- {
- foreach(GLTexture * tex, _shadow_texture)
- {
- glEnable(GL_BLEND);
- glColor4f(1.0f, 1.0f, 1.0f, panel_controller_->opacity());
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- GL::activeTexture(GL_TEXTURE0_ARB);
- tex->enable(GLTexture::Fast);
-
- glTexParameteri(tex->target(), GL_TEXTURE_WRAP_S, GL_REPEAT);
-
- glBegin(GL_QUADS);
- {
- glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), 0), COMP_TEX_COORD_Y(tex->matrix(), 0));
- glVertex2f(vc[0], vc[2]);
-
- glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), 0), COMP_TEX_COORD_Y(tex->matrix(), h));
- glVertex2f(vc[0], vc[3]);
-
- glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), w), COMP_TEX_COORD_Y(tex->matrix(), h));
- glVertex2f(vc[1], vc[3]);
-
- glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), w), COMP_TEX_COORD_Y(tex->matrix(), 0));
- glVertex2f(vc[1], vc[2]);
- }
- glEnd();
-
- tex->disable();
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glDisable(GL_BLEND);
- }
- }
- glPopMatrix();
-#else
return;
if (sources_.GetSource(local::RELAYOUT_TIMEOUT))
@@ -746,7 +623,6 @@ void UnityScreen::paintPanelShadow(const GLMatrix& matrix)
}
}
nuxEpilogue();
-#endif
}
void
@@ -767,73 +643,13 @@ UnityScreen::OnPanelStyleChanged()
panel_texture_has_changed_ = true;
}
-#ifdef USE_MODERN_COMPIZ_GL
void UnityScreen::paintDisplay()
-#else
-void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask)
-#endif
{
CompOutput *output = _last_output;
-#ifndef USE_MODERN_COMPIZ_GL
- bool was_bound = _fbo->bound ();
-
- if (nux::GetGraphicsDisplay()->GetGraphicsEngine()->UsingGLSLCodePath())
- {
- if (was_bound && launcher_controller_->IsOverlayOpen() && paint_panel_)
- {
- if (panel_texture_has_changed_ || !panel_texture_.IsValid())
- {
- panel_texture_.Release();
-
- nux::NBitmapData* bitmap = panel::Style::Instance().GetBackground(screen->width (), screen->height(), 1.0f);
- nux::BaseTexture* texture2D = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture();
- if (bitmap && texture2D)
- {
- texture2D->Update(bitmap);
- panel_texture_ = texture2D->GetDeviceTexture();
- texture2D->UnReference();
- delete bitmap;
- }
- panel_texture_has_changed_ = false;
- }
-
- if (panel_texture_.IsValid())
- {
- nux::GetGraphicsDisplay()->GetGraphicsEngine()->ResetModelViewMatrixStack();
- nux::GetGraphicsDisplay()->GetGraphicsEngine()->Push2DTranslationModelViewMatrix(0.0f, 0.0f, 0.0f);
- nux::GetGraphicsDisplay()->GetGraphicsEngine()->ResetProjectionMatrix();
- nux::GetGraphicsDisplay()->GetGraphicsEngine()->SetOrthographicProjectionMatrix(screen->width (), screen->height());
-
- nux::TexCoordXForm texxform;
- int panel_height = panel_style_.panel_height;
- nux::GetGraphicsDisplay()->GetGraphicsEngine()->QRP_GLSL_1Tex(0, 0, screen->width (), panel_height, panel_texture_, texxform, nux::color::White);
- }
- }
- }
-
- _fbo->unbind ();
-
- /* Draw the bit of the relevant framebuffer for each output */
-
- if (was_bound)
- {
- GLMatrix sTransform;
- sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA);
- glPushMatrix ();
- glLoadMatrixf (sTransform.getMatrix ());
- _fbo->paint (nux::Geometry (output->x (), output->y (), output->width (), output->height ()));
- glPopMatrix ();
- }
-
- nux::ObjectPtr<nux::IOpenGLBaseTexture> device_texture =
- nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(),
- screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8);
-#else
nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =
nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (),
screen->width(), screen->height(), 1, nux::BITFMT_R8G8B8A8);
-#endif
nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;
@@ -841,12 +657,10 @@ void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transfo
nux::Geometry oGeo = nux::Geometry (output->x (), output->y (), output->width (), output->height ());
BackgroundEffectHelper::monitor_rect_ = geo;
-#ifdef USE_MODERN_COMPIZ_GL
GLint fboID;
// Nux renders to the referenceFramebuffer when it's embedded.
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fboID);
wt->GetWindowCompositor().SetReferenceFramebuffer(fboID, oGeo);
-#endif
nuxPrologue();
_in_paint = true;
@@ -864,56 +678,28 @@ void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transfo
{
GLMatrix oTransform;
UnityWindow *uTrayWindow = UnityWindow::get (tray);
-#ifndef USE_MODERN_COMPIZ_GL
- GLFragment::Attrib attrib (uTrayWindow->gWindow->lastPaintAttrib());
-#else
GLWindowPaintAttrib attrib (uTrayWindow->gWindow->lastPaintAttrib());
-#endif
unsigned int oldGlAddGeometryIndex = uTrayWindow->gWindow->glAddGeometryGetCurrentIndex ();
unsigned int oldGlDrawIndex = uTrayWindow->gWindow->glDrawGetCurrentIndex ();
-#ifndef USE_MODERN_COMPIZ_GL
- unsigned int oldGlDrawGeometryIndex = uTrayWindow->gWindow->glDrawGeometryGetCurrentIndex ();
-#endif
-#ifndef USE_MODERN_COMPIZ_GL
- attrib.setOpacity (OPAQUE);
- attrib.setBrightness (BRIGHT);
- attrib.setSaturation (COLOR);
-#else
attrib.opacity = OPAQUE;
attrib.brightness = BRIGHT;
attrib.saturation = COLOR;
-#endif
oTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
-#ifndef USE_MODERN_COMPIZ_GL
- glPushMatrix ();
- glLoadMatrixf (oTransform.getMatrix ());
-#endif
-
painting_tray_ = true;
/* force the use of the core functions */
uTrayWindow->gWindow->glDrawSetCurrentIndex (MAXSHORT);
uTrayWindow->gWindow->glAddGeometrySetCurrentIndex ( MAXSHORT);
-#ifndef USE_MODERN_COMPIZ_GL
- 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_MODERN_COMPIZ_GL
- uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (oldGlDrawGeometryIndex);
-#endif
uTrayWindow->gWindow->glAddGeometrySetCurrentIndex (oldGlAddGeometryIndex);
uTrayWindow->gWindow->glDrawSetCurrentIndex (oldGlDrawIndex);
painting_tray_ = false;
-
-#ifndef USE_MODERN_COMPIZ_GL
- glPopMatrix ();
-#endif
}
}
}
@@ -1350,26 +1136,6 @@ bool UnityScreen::glPaintOutput(const GLScreenPaintAttrib& attrib,
_last_output = output;
paint_panel_ = false;
-#ifndef USE_MODERN_COMPIZ_GL
- /* bind the framebuffer here
- * - it will be unbound and flushed
- * to the backbuffer when some
- * plugin requests to draw a
- * a transformed screen or when
- * we have finished this draw cycle.
- * once an fbo is bound any further
- * attempts to bind it will only increment
- * its bind reference so make sure that
- * you always unbind as much as you bind
- *
- * But NOTE: It is only safe to bind the FBO if !shellCouldBeHidden.
- * Otherwise it's possible painting won't occur and that would
- * confuse the state of the FBO.
- */
- if (doShellRepaint && !shellCouldBeHidden(*output))
- _fbo->bind (nux::Geometry (output->x (), output->y (), output->width (), output->height ()));
-#endif
-
// CompRegion has no clear() method. So this is the fastest alternative.
fullscreenRegion = CompRegion();
nuxRegion = CompRegion();
@@ -1381,11 +1147,7 @@ bool UnityScreen::glPaintOutput(const GLScreenPaintAttrib& attrib,
doShellRepaint = false;
if (doShellRepaint)
-#ifdef USE_MODERN_COMPIZ_GL
paintDisplay();
-#else
- paintDisplay(region, transform, mask);
-#endif
return ret;
}
@@ -1415,10 +1177,6 @@ void UnityScreen::preparePaint(int ms)
for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows)
wi->HandleAnimations (ms);
-#ifndef USE_MODERN_COMPIZ_GL
- compizDamageNux(cScreen->currentDamage());
-#endif
-
didShellRepaint = false;
firstWindowAboveShell = NULL;
}
@@ -1545,7 +1303,6 @@ void UnityScreen::compizDamageNux(CompRegion const& damage)
/* Grab changed nux regions and add damage rects for them */
void UnityScreen::nuxDamageCompiz()
{
-#ifdef USE_MODERN_COMPIZ_GL
/*
* If Nux is going to redraw anything then we have to tell Compiz to
* redraw everything. This is because Nux has a bad habit (bug??) of drawing
@@ -1565,60 +1322,6 @@ void UnityScreen::nuxDamageCompiz()
cScreen->damageScreen();
cScreen->damageRegionSetEnabled(this, true);
}
-
-#else
-
- /*
- * WARNING: Nux bug LP: #1014610 (unbounded DrawList growth) will cause
- * this code to be called far too often in some cases and
- * Unity will appear to freeze for a while. Please ensure you
- * have Nux 3.0+ with the fix for LP: #1014610.
- */
-
- if (!launcher_controller_ || !dash_controller_)
- return;
-
- CompRegion nux_damage;
-
- std::vector<nux::Geometry> const& dirty = wt->GetDrawList();
-
- for (auto const& geo : dirty)
- nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height);
-
- if (launcher_controller_->IsOverlayOpen())
- {
- nux::BaseWindow* dash_window = dash_controller_->window();
- nux::Geometry const& geo = dash_window->GetAbsoluteGeometry();
- nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height);
- }
-
- auto const& launchers = launcher_controller_->launchers();
- for (auto const& launcher : launchers)
- {
- if (!launcher->Hidden())
- {
- nux::ObjectPtr<nux::View> tooltip = launcher->GetActiveTooltip();
-
- if (tooltip)
- {
- nux::Geometry const& g = tooltip->GetAbsoluteGeometry();
- nux_damage += CompRegion(g.x, g.y, g.width, g.height);
- }
-
- nux::ObjectPtr<LauncherDragWindow> const& dragged_icon = launcher->GetDraggedIcon();
-
- if (dragged_icon)
- {
- nux::Geometry const& g = dragged_icon->GetAbsoluteGeometry();
- nux_damage += CompRegion(g.x, g.y, g.width, g.height);
- }
- }
- }
-
- cScreen->damageRegionSetEnabled(this, false);
- cScreen->damageRegion(nux_damage);
- cScreen->damageRegionSetEnabled(this, true);
-#endif
}
/* handle X Events */
@@ -1633,9 +1336,6 @@ void UnityScreen::handleEvent(XEvent* event)
PluginAdapter::Default()->OnScreenGrabbed();
else if (event->xfocus.mode == NotifyUngrab)
PluginAdapter::Default()->OnScreenUngrabbed();
-#ifndef USE_MODERN_COMPIZ_GL
- cScreen->damageScreen(); // evil hack
-#endif
if (_key_nav_mode_requested)
{
// Close any overlay that is open.
@@ -2600,11 +2300,7 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
!uScreen->fullscreenRegion.contains(window->geometry())
)
{
-#ifdef USE_MODERN_COMPIZ_GL
uScreen->paintDisplay();
-#else
- uScreen->paintDisplay(region, matrix, mask);
-#endif
}
if (window->type() == CompWindowTypeDesktopMask)
@@ -3121,14 +2817,6 @@ void UnityScreen::Relayout()
if (!needsRelayout)
return;
-#ifndef USE_MODERN_COMPIZ_GL
- if (GL::fbo)
- {
- uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
- uScreen->_fbo->onScreenSizeChanged (geometry);
- }
-#endif
-
UScreen *uscreen = UScreen::GetDefault();
int primary_monitor = uscreen->GetPrimaryMonitor();
auto geo = uscreen->GetMonitorGeometry(primary_monitor);
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 21498f0cf..fbe7e4c53 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -55,9 +55,6 @@
#include "UnityshellPrivate.h"
#include "UnityShowdesktopHandler.h"
#include "ThumbnailGenerator.h"
-#ifndef USE_MODERN_COMPIZ_GL
-#include "ScreenEffectFramebufferObject.h"
-#endif
#include "compizminimizedwindowhandler.h"
#include "BGHash.h"
@@ -97,11 +94,7 @@ public:
void nuxEpilogue();
/* nux draw wrapper */
-#ifdef USE_MODERN_COMPIZ_GL
void paintDisplay();
-#else
- void paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask);
-#endif
void paintPanelShadow(const GLMatrix& matrix);
void setPanelShadowMatrix(const GLMatrix& matrix);
@@ -311,12 +304,7 @@ private:
BGHash _bghash;
-#ifdef USE_MODERN_COMPIZ_GL
::GLFramebufferObject *oldFbo;
-#else
- ScreenEffectFramebufferObject::Ptr _fbo;
- GLuint _active_fbo;
-#endif
bool queryForShader ();
@@ -337,10 +325,6 @@ private:
bool scale_just_activated_;
-#ifndef USE_MODERN_COMPIZ_GL
- ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP;
-#endif
-
UBusManager ubus_manager_;
glib::SourceManager sources_;
unity::ThumbnailGenerator thumb_generator;
@@ -386,11 +370,7 @@ public:
/* basic window draw function */
bool glDraw(const GLMatrix& matrix,
-#ifndef USE_MODERN_COMPIZ_GL
- GLFragment::Attrib& attrib,
-#else
const GLWindowPaintAttrib& attrib,
-#endif
const CompRegion& region,
unsigned intmask);