Zoom effect ported to GLES

This commit is contained in:
Martin Gräßlin 2010-12-08 18:45:23 +01:00
parent 5c22ffb5f2
commit db4c81993a
2 changed files with 6 additions and 5 deletions

View file

@ -79,12 +79,12 @@ include( slidingpopups/CMakeLists.txt )
include( taskbarthumbnail/CMakeLists.txt )
include( thumbnailaside/CMakeLists.txt )
include( windowgeometry/CMakeLists.txt )
include( zoom/CMakeLists.txt )
if( NOT KWIN_HAVE_OPENGLES_COMPOSITING )
include( logout/CMakeLists.txt )
include( shadow/CMakeLists.txt )
include( showfps/CMakeLists.txt )
include( zoom/CMakeLists.txt )
endif( NOT KWIN_HAVE_OPENGLES_COMPOSITING )
# OpenGL-specific effects

View file

@ -38,10 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/extensions/Xfixes.h>
#include <X11/Xcursor/Xcursor.h>
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
#include <GL/gl.h>
#endif
namespace KWin
{
@ -348,7 +344,9 @@ void ZoomEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
if( texture )
{
#ifndef KWIN_HAVE_OPENGLES
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
#endif
texture->bind();
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
@ -363,7 +361,10 @@ void ZoomEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
QRect rect(p.x() * zoom + data.xTranslate, p.y() * zoom + data.yTranslate, w, h);
texture->render(region, rect);
texture->unbind();
glDisable(GL_BLEND);
#ifndef KWIN_HAVE_OPENGLES
glPopAttrib();
#endif
}
#endif
#ifdef KWIN_HAVE_XRENDER_COMPOSITING