From 70d35d602fc1e15b26fe1b353e25f78f174a5956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 30 Jul 2014 16:20:08 +0200 Subject: [PATCH] Remove SceneOpenGL2Window::prepare/restoreStates() Dead code. --- scene_opengl.cpp | 54 ------------------------------------------------ scene_opengl.h | 13 ------------ 2 files changed, 67 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 243aae0ac2..052d71fe8f 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1205,60 +1205,6 @@ void SceneOpenGL2Window::performPaint(int mask, QRegion region, WindowPaintData endRenderWindow(); } -void SceneOpenGL2Window::prepareStates(TextureType type, qreal opacity, qreal brightness, qreal saturation, int screen) -{ - // setup blending of transparent windows - bool opaque = isOpaque() && opacity == 1.0; - bool alpha = toplevel->hasAlpha() || type != Content; - if (type != Content) { - if (type == Shadow) { - opaque = false; - } else { - if (opacity == 1.0 && toplevel->isClient()) { - opaque = !(static_cast(toplevel)->decorationHasAlpha()); - } else { - // TODO: add support in Deleted - opaque = false; - } - } - } - if (!opaque) { - glEnable(GL_BLEND); - if (alpha) { - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - } else { - glBlendColor((float)opacity, (float)opacity, (float)opacity, (float)opacity); - glBlendFunc(GL_ONE, GL_ONE_MINUS_CONSTANT_ALPHA); - } - } - m_blendingEnabled = !opaque; - - const qreal rgb = brightness * opacity; - const qreal a = opacity; - - GLShader *shader = ShaderManager::instance()->getBoundShader(); - shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a)); - shader->setUniform(GLShader::Saturation, saturation); - - if (ColorCorrection *cc = static_cast(m_scene)->colorCorrection()) { - cc->setupForOutput(screen); - } -} - -void SceneOpenGL2Window::restoreStates(TextureType type, qreal opacity, qreal brightness, qreal saturation) -{ - Q_UNUSED(type); - Q_UNUSED(opacity); - Q_UNUSED(brightness); - Q_UNUSED(saturation); - if (m_blendingEnabled) { - glDisable(GL_BLEND); - } - - if (ColorCorrection *cc = static_cast(m_scene)->colorCorrection()) { - cc->setupForOutput(-1); - } -} //**************************************** // OpenGLWindowPixmap diff --git a/scene_opengl.h b/scene_opengl.h index fb10c45a7f..17365e20d8 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -209,17 +209,6 @@ protected: QMatrix4x4 transformation(int mask, const WindowPaintData &data) const; GLTexture *getDecorationTexture() const; - virtual void prepareStates(TextureType type, qreal opacity, qreal brightness, qreal saturation, int screen) = 0; - /** - * @brief Restores the OpenGL rendering state after the texture with @p type has been rendered. - * - * @param type The type of the Texture which has been rendered - * @param opacity The opacity value used for the rendering - * @param brightness The brightness value used for this rendering - * @param saturation The saturation value used for this rendering - * @param screen The index of the screen to use for this rendering - **/ - virtual void restoreStates(TextureType type, qreal opacity, qreal brightness, qreal saturation) = 0; protected: SceneOpenGL *m_scene; @@ -262,8 +251,6 @@ protected: void setBlendEnabled(bool enabled); void setupLeafNodes(LeafNode *nodes, const WindowQuadList *quads, const WindowPaintData &data); virtual void performPaint(int mask, QRegion region, WindowPaintData data); - virtual void prepareStates(TextureType type, qreal opacity, qreal brightness, qreal saturation, int screen); - virtual void restoreStates(TextureType type, qreal opacity, qreal brightness, qreal saturation); private: /**