diff --git a/libkwineffects/kwinglcolorcorrection.cpp b/libkwineffects/kwinglcolorcorrection.cpp index 3c066fb4c7..a274827172 100644 --- a/libkwineffects/kwinglcolorcorrection.cpp +++ b/libkwineffects/kwinglcolorcorrection.cpp @@ -268,7 +268,6 @@ ColorCorrectionPrivate::ColorCorrectionPrivate(ColorCorrection *parent) this); m_outputCluts = &m_csi->outputCluts(); - m_regionCluts = &m_csi->regionCluts(); connect(m_csi, SIGNAL(updateSucceeded()), this, SLOT(colorServerUpdateSucceededSlot())); connect(m_csi, SIGNAL(updateFailed()), this, SLOT(colorServerUpdateFailedSlot())); @@ -309,20 +308,6 @@ void ColorCorrection::setEnabled(bool enabled) kDebug(1212) << enabled; } -QMap::const_iterator ColorCorrection::regionsBegin(Window w) -{ - Q_D(ColorCorrection); - return d->m_windowRegions.constFind(w); -} - -QMap::const_iterator ColorCorrection::regionsEnd(Window w) -{ - Q_D(ColorCorrection); - QMap::const_iterator it = d->m_windowRegions.constFind(w); - while (it != d->m_windowRegions.constEnd() && it.key() == w) ++it; - return it; -} - void ColorCorrection::setupForOutput(int screen) { Q_D(ColorCorrection); @@ -365,31 +350,6 @@ void ColorCorrection::setupForOutput(int screen) d->m_lastOutput = screen; } -void ColorCorrection::setupForRegion(const QMap::const_iterator ®ionIt) -{ -#ifndef KWIN_HAVE_OPENGLES - Q_D(ColorCorrection); - const QRect *key = &(*regionIt); - GLuint tex = d->m_regionCCTextures.value(key, d->m_dummyCCTexture); - - // Bind the correct color lookup texture - GLint activeTexture; - glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTexture); - glActiveTexture(GL_TEXTURE0 + d->m_ccTextureUnit); - glEnable(GL_TEXTURE_3D); - glBindTexture(GL_TEXTURE_3D, tex); - glActiveTexture(activeTexture); -#else - Q_UNUSED(regionIt); -#endif -} - -void ColorCorrection::resetForRegion() -{ - Q_D(ColorCorrection); - setupForOutput(d->m_lastOutput); -} - void ColorCorrection::reset() { setupForOutput(-1); @@ -613,24 +573,6 @@ void ColorCorrectionPrivate::setupCCTextures() setupCCTexture(m_outputCCTextures[i], m_outputCluts->at(i)); } - if (m_regionCCTextures.isEmpty() && !m_regionCluts->isEmpty()) { - Q_ASSERT(m_windowRegions.isEmpty()); - kDebug(1212) << "setting up region color correction textures"; - - // Generate region textures (and place them inside a map) - RegionalClutMap::const_iterator rcit; - QMap::const_iterator rit; - for (rcit = m_regionCluts->begin(); rcit != m_regionCluts->end(); ++rcit) { - GLuint tex; - glGenTextures(1, &tex); - setupCCTexture(tex, rcit->c); - - // Insert the new texture into the region maps - rit = m_windowRegions.insert(rcit.key(), rcit->r); // this one maps Window -> QRect - m_regionCCTextures.insert(&(*rit), tex); // this one maps QRect* -> texture - } - } - // TODO Handle errors (what if a texture isn't generated?) } @@ -647,13 +589,6 @@ void ColorCorrectionPrivate::deleteCCTextures() glDeleteTextures(m_outputCCTextures.size(), m_outputCCTextures.data()); m_outputCCTextures.clear(); } - if (!m_regionCCTextures.isEmpty()) { - QMap::const_iterator it; - for (it = m_regionCCTextures.begin(); it != m_regionCCTextures.end(); ++it) - glDeleteTextures(1, &(*it)); - m_regionCCTextures.clear(); - m_windowRegions.clear(); - } } void ColorCorrectionPrivate::setupCCTexture(GLuint texture, const Clut& clut) diff --git a/libkwineffects/kwinglcolorcorrection.h b/libkwineffects/kwinglcolorcorrection.h index ee2497f21d..0c7e66b01f 100644 --- a/libkwineffects/kwinglcolorcorrection.h +++ b/libkwineffects/kwinglcolorcorrection.h @@ -51,52 +51,12 @@ public: static ColorCorrection *instance(); static void cleanup(); - /** - * The beginning of a region list for a window \param w - * \return Constant iterator to the beginning - * \see setupForRegion - * - * It can be used to indicate a particular region for which - * to set up color correction. - * - * These regions come from the applications, which communicate with the - * color server (kolor-server in kolor-manager), and this has no direct - * relation to KWin. Consequently, modifying these regions does not - * make sense inside KWin. - */ - QMap::const_iterator regionsBegin(Window w); - - /** - * The ending of a region list for a window \param w - * \return Constant iterator to the ending - * \see setupForRegion - */ - QMap::const_iterator regionsEnd(Window w); - /** * Prepares color correction for the output number \param screen. * Sets up the appropriate color lookup texture for the output. */ void setupForOutput(int screen); - /** - * Prepares color correction for one region of a window (in fact a rect), - * which is indicated by \param regionIt. This can be obtained by iterating - * between \ref regionsBegin and \ref regionsEnd, for that particular window. - * - * \note This should be called when drawing a window - */ - void setupForRegion(const QMap::const_iterator ®ionIt); - - /** - * Disables color correction for a particular window region. Instead, - * color correction is set up again for the last output that was set - * with \ref setupForOutput. - * - * \note This should be called after finishing the drawing of a window. - */ - void resetForRegion(); - /** * Unsets color correction by using a dummy color lookup texture. This * does not disable anything, the CC mechanisms remain in place. Instead, it diff --git a/libkwineffects/kwinglcolorcorrection_p.h b/libkwineffects/kwinglcolorcorrection_p.h index e244d01035..65269df188 100644 --- a/libkwineffects/kwinglcolorcorrection_p.h +++ b/libkwineffects/kwinglcolorcorrection_p.h @@ -96,9 +96,6 @@ public: ColorServerInterface *m_csi; const ClutList *m_outputCluts; QVector m_outputCCTextures; - const RegionalClutMap *m_regionCluts; - QMultiMap m_windowRegions; - QMap m_regionCCTextures; // keys from m_regions's values Clut m_dummyClut; GLuint m_dummyCCTexture;