Remove SceneOpenGL2Window::prepare/restoreStates()

Dead code.
icc-effect-5.14.5
Fredrik Höglund 2014-07-30 16:20:08 +02:00
parent 3d3a52c32d
commit 70d35d602f
2 changed files with 0 additions and 67 deletions

View File

@ -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<Client*>(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<SceneOpenGL2*>(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<SceneOpenGL2*>(m_scene)->colorCorrection()) {
cc->setupForOutput(-1);
}
}
//****************************************
// OpenGLWindowPixmap

View File

@ -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:
/**