CC: Remove unused code related to regions, until they get implemented

This commit is contained in:
Casian Andrei 2012-08-27 15:48:18 +03:00
parent 23f3b2a571
commit 34bcf10c51
3 changed files with 0 additions and 108 deletions

View file

@ -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<Window, QRect>::const_iterator ColorCorrection::regionsBegin(Window w)
{
Q_D(ColorCorrection);
return d->m_windowRegions.constFind(w);
}
QMap<Window, QRect>::const_iterator ColorCorrection::regionsEnd(Window w)
{
Q_D(ColorCorrection);
QMap<Window, QRect>::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<Window, QRect>::const_iterator &regionIt)
{
#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<Window, QRect>::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 QRect*, GLuint>::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)

View file

@ -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<Window, QRect>::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<Window, QRect>::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<Window, QRect>::const_iterator &regionIt);
/**
* 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

View file

@ -96,9 +96,6 @@ public:
ColorServerInterface *m_csi;
const ClutList *m_outputCluts;
QVector<GLuint> m_outputCCTextures;
const RegionalClutMap *m_regionCluts;
QMultiMap<Window, QRect> m_windowRegions;
QMap<const QRect*, GLuint> m_regionCCTextures; // keys from m_regions's values
Clut m_dummyClut;
GLuint m_dummyCCTexture;