Add glScaleFilter and xrFilterScale support
This commit is contained in:
parent
e1308f8b40
commit
c79894945c
3 changed files with 61 additions and 5 deletions
|
@ -77,13 +77,24 @@ int Compositing::windowThumbnail() const
|
||||||
return kwinConfig.readEntry("HiddenPreviews", 5) - 4;
|
return kwinConfig.readEntry("HiddenPreviews", 5) - 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Compositing::glSclaleFilter() const
|
||||||
|
{
|
||||||
|
KConfigGroup kwinConfig(KSharedConfig::openConfig("kwinrc"), "Compositing");
|
||||||
|
return kwinConfig.readEntry("GLTextureFilter", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Compositing::xrSclaleFilter() const
|
||||||
|
{
|
||||||
|
KConfigGroup kwinConfig(KSharedConfig::openConfig("kwinrc"), "Compositing");
|
||||||
|
return kwinConfig.readEntry("XRenderSmoothScale", false);
|
||||||
|
}
|
||||||
|
|
||||||
CompositingType::CompositingType(QObject *parent)
|
CompositingType::CompositingType(QObject *parent)
|
||||||
: QAbstractItemModel(parent) {
|
: QAbstractItemModel(parent) {
|
||||||
|
|
||||||
generateCompositing();
|
generateCompositing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CompositingType::generateCompositing()
|
void CompositingType::generateCompositing()
|
||||||
{
|
{
|
||||||
QHash<QString, CompositingType::CompositingTypeIndex> compositingTypes;
|
QHash<QString, CompositingType::CompositingTypeIndex> compositingTypes;
|
||||||
|
@ -185,7 +196,7 @@ int CompositingType::currentOpenGLType()
|
||||||
return currentIndex;
|
return currentIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowThumbnail)
|
void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter)
|
||||||
{
|
{
|
||||||
QString backend;
|
QString backend;
|
||||||
bool glLegacy;
|
bool glLegacy;
|
||||||
|
@ -221,6 +232,8 @@ void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowT
|
||||||
kwinConfig.writeEntry("GLCore", glCore);
|
kwinConfig.writeEntry("GLCore", glCore);
|
||||||
kwinConfig.writeEntry("AnimationSpeed", animationSpeed);
|
kwinConfig.writeEntry("AnimationSpeed", animationSpeed);
|
||||||
kwinConfig.writeEntry("HiddenPreviews", windowThumbnail + 4);
|
kwinConfig.writeEntry("HiddenPreviews", windowThumbnail + 4);
|
||||||
|
kwinConfig.writeEntry("GLTextureFilter", glSclaleFilter);
|
||||||
|
kwinConfig.writeEntry("XRenderSmoothScale", xrSclaleFilter);
|
||||||
kwinConfig.sync();
|
kwinConfig.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ class Compositing : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int animationSpeed READ animationSpeed CONSTANT);
|
Q_PROPERTY(int animationSpeed READ animationSpeed CONSTANT);
|
||||||
Q_PROPERTY(int windowThumbnail READ windowThumbnail CONSTANT);
|
Q_PROPERTY(int windowThumbnail READ windowThumbnail CONSTANT);
|
||||||
|
Q_PROPERTY(int glSclaleFilter READ glSclaleFilter CONSTANT);
|
||||||
|
Q_PROPERTY(bool xrSclaleFilter READ xrSclaleFilter CONSTANT);
|
||||||
public:
|
public:
|
||||||
explicit Compositing(QObject *parent = 0);
|
explicit Compositing(QObject *parent = 0);
|
||||||
|
|
||||||
|
@ -41,6 +43,8 @@ public:
|
||||||
Q_INVOKABLE bool OpenGLIsBroken();
|
Q_INVOKABLE bool OpenGLIsBroken();
|
||||||
int animationSpeed() const;
|
int animationSpeed() const;
|
||||||
int windowThumbnail() const;
|
int windowThumbnail() const;
|
||||||
|
int glSclaleFilter() const;
|
||||||
|
bool xrSclaleFilter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -84,7 +88,7 @@ public:
|
||||||
virtual QHash< int, QByteArray > roleNames() const override;
|
virtual QHash< int, QByteArray > roleNames() const override;
|
||||||
|
|
||||||
Q_INVOKABLE int currentOpenGLType();
|
Q_INVOKABLE int currentOpenGLType();
|
||||||
Q_INVOKABLE void syncConfig(int openGLType, int animationSpeed, int windowThumbnail);
|
Q_INVOKABLE void syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void generateCompositing();
|
void generateCompositing();
|
||||||
|
|
|
@ -66,7 +66,11 @@ Item {
|
||||||
currentIndex: compositingType.currentOpenGLType()
|
currentIndex: compositingType.currentOpenGLType()
|
||||||
anchors.top: windowManagement.bottom
|
anchors.top: windowManagement.bottom
|
||||||
anchors.left: col.right
|
anchors.left: col.right
|
||||||
onCurrentIndexChanged: apply.enabled = true
|
onCurrentIndexChanged: {
|
||||||
|
apply.enabled = true;
|
||||||
|
glScaleFilter.visible = currentIndex != 3;
|
||||||
|
xrScaleFilter.visible = currentIndex == 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
@ -118,6 +122,41 @@ Item {
|
||||||
onCurrentIndexChanged: apply.enabled = true;
|
onCurrentIndexChanged: apply.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: scaleFilterText
|
||||||
|
text: i18n("Scale Method:")
|
||||||
|
anchors {
|
||||||
|
top: windowThumbnail.bottom
|
||||||
|
horizontalCenter: windowManagement.horizontalCenter
|
||||||
|
topMargin: 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox {
|
||||||
|
id: glScaleFilter
|
||||||
|
model: [i18n("Crisp"), i18n("Smooth"), i18n("Accurate")]
|
||||||
|
visible: openGLType.currentIndex != 3
|
||||||
|
currentIndex: compositing.glScaleFilter
|
||||||
|
anchors {
|
||||||
|
top: scaleFilterText.bottom
|
||||||
|
left: col.right
|
||||||
|
}
|
||||||
|
onCurrentIndexChanged: apply.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox {
|
||||||
|
id: xrScaleFilter
|
||||||
|
model: [i18n("Crisp"), i18n("Smooth (slower)")]
|
||||||
|
visible: openGLType.currentIndex == 3
|
||||||
|
currentIndex: compositing.xrScaleFilter ? 1 : 0
|
||||||
|
anchors {
|
||||||
|
top: scaleFilterText.bottom
|
||||||
|
left: glScaleFilter.visible ? glScaleFilter.right : col.right
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
onCurrentIndexChanged: apply.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: col
|
id: col
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
@ -197,7 +236,7 @@ Item {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
searchModel.syncConfig();
|
searchModel.syncConfig();
|
||||||
apply.enabled = false;
|
apply.enabled = false;
|
||||||
compositingType.syncConfig(openGLType.currentIndex, animationSpeed.value, windowThumbnail.currentIndex);
|
compositingType.syncConfig(openGLType.currentIndex, animationSpeed.value, windowThumbnail.currentIndex, glScaleFilter.currentIndex, xrScaleFilter.currentIndex == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue