Add Color Correction support
parent
748d2d327f
commit
bd3219b5a7
|
@ -113,6 +113,12 @@ int Compositing::glSwapStrategy() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Compositing::glColorCorrection() const
|
||||||
|
{
|
||||||
|
KConfigGroup kwinConfig(KSharedConfig::openConfig("kwinrc"), "Compositing");
|
||||||
|
return kwinConfig.readEntry("GLColorCorrection", false);
|
||||||
|
}
|
||||||
|
|
||||||
CompositingType::CompositingType(QObject *parent)
|
CompositingType::CompositingType(QObject *parent)
|
||||||
: QAbstractItemModel(parent) {
|
: QAbstractItemModel(parent) {
|
||||||
|
|
||||||
|
@ -221,7 +227,7 @@ int CompositingType::currentOpenGLType()
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter,
|
void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter,
|
||||||
bool unredirectFullscreen, int glSwapStrategy)
|
bool unredirectFullscreen, int glSwapStrategy, bool glColorCorrection)
|
||||||
{
|
{
|
||||||
QString glSwapStrategyValue;
|
QString glSwapStrategyValue;
|
||||||
QString backend;
|
QString backend;
|
||||||
|
@ -282,6 +288,7 @@ void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowT
|
||||||
kwinConfig.writeEntry("XRenderSmoothScale", xrSclaleFilter);
|
kwinConfig.writeEntry("XRenderSmoothScale", xrSclaleFilter);
|
||||||
kwinConfig.writeEntry("UnredirectFullscreen", unredirectFullscreen);
|
kwinConfig.writeEntry("UnredirectFullscreen", unredirectFullscreen);
|
||||||
kwinConfig.writeEntry("GLPreferBufferSwap", glSwapStrategyValue);
|
kwinConfig.writeEntry("GLPreferBufferSwap", glSwapStrategyValue);
|
||||||
|
kwinConfig.writeEntry("GLColorCorrection", glColorCorrection);
|
||||||
kwinConfig.sync();
|
kwinConfig.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ class Compositing : public QObject
|
||||||
Q_PROPERTY(bool xrSclaleFilter READ xrSclaleFilter CONSTANT);
|
Q_PROPERTY(bool xrSclaleFilter READ xrSclaleFilter CONSTANT);
|
||||||
Q_PROPERTY(bool unredirectFullscreen READ unredirectFullscreen CONSTANT);
|
Q_PROPERTY(bool unredirectFullscreen READ unredirectFullscreen CONSTANT);
|
||||||
Q_PROPERTY(int glSwapStrategy READ glSwapStrategy CONSTANT);
|
Q_PROPERTY(int glSwapStrategy READ glSwapStrategy CONSTANT);
|
||||||
|
Q_PROPERTY(bool glColorCorrection READ glColorCorrection CONSTANT);
|
||||||
public:
|
public:
|
||||||
explicit Compositing(QObject *parent = 0);
|
explicit Compositing(QObject *parent = 0);
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ public:
|
||||||
bool xrSclaleFilter() const;
|
bool xrSclaleFilter() const;
|
||||||
bool unredirectFullscreen() const;
|
bool unredirectFullscreen() const;
|
||||||
int glSwapStrategy() const;
|
int glSwapStrategy() const;
|
||||||
|
bool glColorCorrection() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -93,7 +95,7 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE int currentOpenGLType();
|
Q_INVOKABLE int currentOpenGLType();
|
||||||
Q_INVOKABLE void syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter,
|
Q_INVOKABLE void syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter,
|
||||||
bool unredirectFullscreen, int glSwapStrategy);
|
bool unredirectFullscreen, int glSwapStrategy, bool glColorCorrection);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void generateCompositing();
|
void generateCompositing();
|
||||||
|
|
|
@ -70,6 +70,7 @@ Item {
|
||||||
apply.enabled = true;
|
apply.enabled = true;
|
||||||
glScaleFilter.visible = currentIndex != 3;
|
glScaleFilter.visible = currentIndex != 3;
|
||||||
xrScaleFilter.visible = currentIndex == 3;
|
xrScaleFilter.visible = currentIndex == 3;
|
||||||
|
glColorCorrection.enabled = currentIndex !=3 && glColorCorrection !=4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,6 +189,18 @@ Item {
|
||||||
onCurrentIndexChanged: apply.enabled = true;
|
onCurrentIndexChanged: apply.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckBox {
|
||||||
|
id: glColorCorrection
|
||||||
|
text: i18n("Enable color correction (experimental)")
|
||||||
|
checked: compositing.glColorCorrection
|
||||||
|
enabled: openGLType.currentIndex != 3 && openGLType.currentIndex != 4
|
||||||
|
anchors {
|
||||||
|
top: glSwapStrategy.bottom
|
||||||
|
left: col.right
|
||||||
|
}
|
||||||
|
onClicked: apply.enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: col
|
id: col
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
@ -267,7 +280,8 @@ Item {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
searchModel.syncConfig();
|
searchModel.syncConfig();
|
||||||
apply.enabled = false;
|
apply.enabled = false;
|
||||||
compositingType.syncConfig(openGLType.currentIndex, animationSpeed.value, windowThumbnail.currentIndex, glScaleFilter.currentIndex, xrScaleFilter.currentIndex == 1, unredirectFullScreen.checked, glSwapStrategy.currentIndex);
|
compositingType.syncConfig(openGLType.currentIndex, animationSpeed.value, windowThumbnail.currentIndex, glScaleFilter.currentIndex, xrScaleFilter.currentIndex == 1,
|
||||||
|
unredirectFullScreen.checked, glSwapStrategy.currentIndex, glColorCorrection.checked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue