CC: Rename "glColorCorrection" property to "colorCorrected"
This commit is contained in:
parent
2afa88a889
commit
7d331ea7ff
4 changed files with 20 additions and 19 deletions
|
@ -142,8 +142,8 @@ void Workspace::slotCompositingOptionsInitialized()
|
|||
}
|
||||
#endif
|
||||
|
||||
kDebug(1212) << "Color correction:" << options->isGlColorCorrection();
|
||||
ColorCorrection::instance()->setEnabled(options->isGlColorCorrection());
|
||||
kDebug(1212) << "Color correction:" << options->isColorCorrected();
|
||||
ColorCorrection::instance()->setEnabled(options->isColorCorrected());
|
||||
connect(ColorCorrection::instance(), SIGNAL(changed()), this, SLOT(addRepaintFull()));
|
||||
|
||||
scene = new SceneOpenGL(this);
|
||||
|
|
13
options.cpp
13
options.cpp
|
@ -148,7 +148,7 @@ Options::Options(QObject *parent)
|
|||
, m_unredirectFullscreen(Options::defaultUnredirectFullscreen())
|
||||
, m_glSmoothScale(Options::defaultGlSmoothScale())
|
||||
, m_glVSync(Options::defaultGlVSync())
|
||||
, m_glColorCorrection(Options::defaultGlColorCorrection())
|
||||
, m_colorCorrected(Options::defaultColorCorrected())
|
||||
, m_xrenderSmoothScale(Options::defaultXrenderSmoothScale())
|
||||
, m_maxFpsInterval(Options::defaultMaxFpsInterval())
|
||||
, m_refreshRate(Options::defaultRefreshRate())
|
||||
|
@ -698,13 +698,13 @@ void Options::setGlVSync(bool glVSync)
|
|||
emit glVSyncChanged();
|
||||
}
|
||||
|
||||
void Options::setGlColorCorrection(bool glColorCorrection)
|
||||
void Options::setColorCorrected(bool colorCorrected)
|
||||
{
|
||||
if (m_glColorCorrection == glColorCorrection) {
|
||||
if (m_colorCorrected == colorCorrected) {
|
||||
return;
|
||||
}
|
||||
m_glColorCorrection = glColorCorrection;
|
||||
emit glColorCorrectionChanged();
|
||||
m_colorCorrected = colorCorrected;
|
||||
emit colorCorrectedChanged();
|
||||
}
|
||||
|
||||
void Options::setXrenderSmoothScale(bool xrenderSmoothScale)
|
||||
|
@ -989,13 +989,14 @@ void Options::reloadCompositingSettings(bool force)
|
|||
|
||||
setGlDirect(prefs.enableDirectRendering());
|
||||
setGlVSync(config.readEntry("GLVSync", Options::defaultGlVSync()));
|
||||
setGlColorCorrection(config.readEntry("GLColorCorrection", Options::defaultGlColorCorrection()));
|
||||
setGlSmoothScale(qBound(-1, config.readEntry("GLTextureFilter", Options::defaultGlSmoothScale()), 2));
|
||||
setGlStrictBindingFollowsDriver(!config.hasKey("GLStrictBinding"));
|
||||
if (!isGlStrictBindingFollowsDriver()) {
|
||||
setGlStrictBinding(config.readEntry("GLStrictBinding", Options::defaultGlStrictBinding()));
|
||||
}
|
||||
|
||||
setColorCorrected(config.readEntry("GLColorCorrection", Options::defaultColorCorrected()));
|
||||
|
||||
m_xrenderSmoothScale = config.readEntry("XRenderSmoothScale", false);
|
||||
|
||||
HiddenPreviews previews = Options::defaultHiddenPreviews();
|
||||
|
|
14
options.h
14
options.h
|
@ -179,7 +179,7 @@ class Options : public QObject, public KDecorationOptions
|
|||
**/
|
||||
Q_PROPERTY(int glSmoothScale READ glSmoothScale WRITE setGlSmoothScale NOTIFY glSmoothScaleChanged)
|
||||
Q_PROPERTY(bool glVSync READ isGlVSync WRITE setGlVSync NOTIFY glVSyncChanged)
|
||||
Q_PROPERTY(bool glColorCorrection READ isGlColorCorrection WRITE setGlColorCorrection NOTIFY glColorCorrectionChanged)
|
||||
Q_PROPERTY(bool colorCorrected READ isColorCorrected WRITE setColorCorrected NOTIFY colorCorrectedChanged)
|
||||
Q_PROPERTY(bool xrenderSmoothScale READ isXrenderSmoothScale WRITE setXrenderSmoothScale NOTIFY xrenderSmoothScaleChanged)
|
||||
Q_PROPERTY(uint maxFpsInterval READ maxFpsInterval WRITE setMaxFpsInterval NOTIFY maxFpsIntervalChanged)
|
||||
Q_PROPERTY(uint refreshRate READ refreshRate WRITE setRefreshRate NOTIFY refreshRateChanged)
|
||||
|
@ -539,8 +539,8 @@ public:
|
|||
bool isGlVSync() const {
|
||||
return m_glVSync;
|
||||
}
|
||||
bool isGlColorCorrection() const {
|
||||
return m_glColorCorrection;
|
||||
bool isColorCorrected() const {
|
||||
return m_colorCorrected;
|
||||
}
|
||||
// XRender
|
||||
bool isXrenderSmoothScale() const {
|
||||
|
@ -621,7 +621,7 @@ public:
|
|||
void setUnredirectFullscreen(bool unredirectFullscreen);
|
||||
void setGlSmoothScale(int glSmoothScale);
|
||||
void setGlVSync(bool glVSync);
|
||||
void setGlColorCorrection(bool glColorCorrection);
|
||||
void setColorCorrected(bool colorCorrected);
|
||||
void setXrenderSmoothScale(bool xrenderSmoothScale);
|
||||
void setMaxFpsInterval(uint maxFpsInterval);
|
||||
void setRefreshRate(uint refreshRate);
|
||||
|
@ -824,7 +824,7 @@ public:
|
|||
static bool defaultGlVSync() {
|
||||
return true;
|
||||
}
|
||||
static bool defaultGlColorCorrection() {
|
||||
static bool defaultColorCorrected() {
|
||||
return false;
|
||||
}
|
||||
static bool defaultXrenderSmoothScale() {
|
||||
|
@ -924,7 +924,7 @@ Q_SIGNALS:
|
|||
void unredirectFullscreenChanged();
|
||||
void glSmoothScaleChanged();
|
||||
void glVSyncChanged();
|
||||
void glColorCorrectionChanged();
|
||||
void colorCorrectedChanged();
|
||||
void xrenderSmoothScaleChanged();
|
||||
void maxFpsIntervalChanged();
|
||||
void refreshRateChanged();
|
||||
|
@ -967,7 +967,7 @@ private:
|
|||
bool m_unredirectFullscreen;
|
||||
int m_glSmoothScale;
|
||||
bool m_glVSync;
|
||||
bool m_glColorCorrection;
|
||||
bool m_colorCorrected;
|
||||
bool m_xrenderSmoothScale;
|
||||
uint m_maxFpsInterval;
|
||||
// Settings that should be auto-detected
|
||||
|
|
|
@ -210,7 +210,7 @@ void SceneOpenGL::paintBackground(QRegion region)
|
|||
|
||||
void SceneOpenGL::finalDrawWindow(EffectWindowImpl* w, int mask, QRegion region, WindowPaintData& data)
|
||||
{
|
||||
if (options->isGlColorCorrection()) {
|
||||
if (options->isColorCorrected()) {
|
||||
// Split the painting for separate screens
|
||||
int numScreens = Workspace::self()->numScreens();
|
||||
for (int screen = 0; screen < numScreens; ++ screen) {
|
||||
|
@ -524,7 +524,7 @@ void SceneOpenGL::Window::performPaint(int mask, QRegion region, WindowPaintData
|
|||
data.shader = ShaderManager::instance()->pushShader(ShaderManager::SimpleShader);
|
||||
data.shader->setUniform(GLShader::Offset, QVector2D(x(), y()));
|
||||
}
|
||||
if (options->isGlColorCorrection())
|
||||
if (options->isColorCorrected())
|
||||
ColorCorrection::instance()->setupForOutput(data.screen());
|
||||
sceneShader = true;
|
||||
}
|
||||
|
@ -865,7 +865,7 @@ void SceneOpenGL::Window::prepareShaderRenderStates(TextureType type, double opa
|
|||
opaque = false;
|
||||
if (!opaque) {
|
||||
glEnable(GL_BLEND);
|
||||
if (!options->isGlColorCorrection()) {
|
||||
if (!options->isColorCorrected()) {
|
||||
if (alpha) {
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
} else {
|
||||
|
@ -883,7 +883,7 @@ void SceneOpenGL::Window::prepareShaderRenderStates(TextureType type, double opa
|
|||
shader->setUniform(GLShader::Saturation, saturation);
|
||||
shader->setUniform(GLShader::AlphaToOne, opaque ? 1 : 0);
|
||||
|
||||
if (options->isGlColorCorrection())
|
||||
if (options->isColorCorrected())
|
||||
ColorCorrection::instance()->setupForOutput(screen);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue