From c37b7cdcbaa68e5abc7d81c9132a5a687d12d2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 1 May 2011 13:03:20 +0200 Subject: [PATCH] GUI option to control new GLLegacy option Needs to be removed when compiled against GLES. --- kcmkwin/kwincompositing/main.cpp | 7 ++++++- kcmkwin/kwincompositing/main.ui | 13 ++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index e8abdfc7a8..8b447253c6 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -124,6 +124,7 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList connect(ui.glDirect, SIGNAL(toggled(bool)), this, SLOT(changed())); connect(ui.glVSync, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(ui.glShaders, SIGNAL(toggled(bool)), this, SLOT(changed())); // Open the temporary config file // Temporary conf file is used to synchronize effect checkboxes with effect @@ -407,6 +408,7 @@ void KWinCompositingConfig::loadAdvancedTab() ui.glDirect->setChecked(config.readEntry("GLDirect", mDefaultPrefs.enableDirectRendering())); ui.glVSync->setChecked(config.readEntry("GLVSync", mDefaultPrefs.enableVSync())); + ui.glShaders->setChecked(!config.readEntry("GLLegacy", false)); toogleSmoothScaleUi(ui.compositingType->currentIndex()); } @@ -539,7 +541,8 @@ bool KWinCompositingConfig::saveAdvancedTab() || config.readEntry("GLDirect", mDefaultPrefs.enableDirectRendering()) != ui.glDirect->isChecked() || config.readEntry("GLVSync", mDefaultPrefs.enableVSync()) != ui.glVSync->isChecked() - || config.readEntry("DisableChecks", false) != ui.disableChecks->isChecked()) { + || config.readEntry("DisableChecks", false) != ui.disableChecks->isChecked() + || config.readEntry("GLLegacy", false) == ui.glShaders->isChecked()) { m_showConfirmDialog = true; advancedChanged = true; } else if (config.readEntry("HiddenPreviews", 5) != hps[ ui.windowThumbnails->currentIndex()] @@ -557,6 +560,7 @@ bool KWinCompositingConfig::saveAdvancedTab() config.writeEntry("GLDirect", ui.glDirect->isChecked()); config.writeEntry("GLVSync", ui.glVSync->isChecked()); + config.writeEntry("GLLegacy", !ui.glShaders->isChecked()); return advancedChanged; @@ -690,6 +694,7 @@ void KWinCompositingConfig::defaults() ui.glScaleFilter->setCurrentIndex(2); ui.glDirect->setChecked(mDefaultPrefs.enableDirectRendering()); ui.glVSync->setChecked(mDefaultPrefs.enableVSync()); + ui.glShaders->setChecked(true); } QString KWinCompositingConfig::quickHelp() const diff --git a/kcmkwin/kwincompositing/main.ui b/kcmkwin/kwincompositing/main.ui index baeed1b221..c5a46df5f8 100644 --- a/kcmkwin/kwincompositing/main.ui +++ b/kcmkwin/kwincompositing/main.ui @@ -610,7 +610,7 @@ p, li { white-space: pre-wrap; } - + Use VSync @@ -620,6 +620,17 @@ p, li { white-space: pre-wrap; } + + + + If enabled all rendering will be perfomed with Shaders written in the OpenGL Shading Language. +On legacy hardware disabling Shaders can improve the performance. + + + Use OpenGL 2 Shaders + + +