remove GlVSync option (it has no UI anymore)

Based on (revision 2 of) https://git.reviewboard.kde.org/r/109086/ by Thomas Lübking

REVIEW: 109086
This commit is contained in:
Ralf Jung 2013-03-27 11:34:25 +01:00
parent 8b2b48b966
commit 72db0e5e71
4 changed files with 11 additions and 34 deletions

View file

@ -96,7 +96,8 @@ void GlxBackend::init()
initGL(GlxPlatformInterface);
// Check whether certain features are supported
haveSwapInterval = glXSwapIntervalMESA || glXSwapIntervalEXT || glXSwapIntervalSGI;
if (options->isGlVSync()) {
const bool wantSync = options->glPreferBufferSwap() != Options::NoSwapEncourage;
if (wantSync) {
if (glXGetVideoSync && haveSwapInterval && glXIsDirect(display(), ctx)) {
unsigned int sync;
if (glXGetVideoSync(&sync) == 0) {
@ -108,14 +109,16 @@ void GlxBackend::init()
// swapinterval (as of today) seems completely unsupported
setHasWaitSync(true);
setSwapInterval(1);
}
else
} else
qWarning() << "NO VSYNC! glXWaitVideoSync(1,0,&uint) isn't 0 but" << glXWaitVideoSync(1, 0, &sync);
} else
qWarning() << "NO VSYNC! glXGetVideoSync(&uint) isn't 0 but" << glXGetVideoSync(&sync);
} else
qWarning() << "NO VSYNC! glXGetVideoSync, haveSwapInterval, glXIsDirect" <<
bool(glXGetVideoSync) << haveSwapInterval << glXIsDirect(display(), ctx);
} else {
// disable v-sync (if possible)
setSwapInterval(0);
}
if (glPlatform->isVirtualBox()) {
// VirtualBox does not support glxQueryDrawable

View file

@ -235,9 +235,6 @@
<entry name="Enabled" type="Bool">
<default>true</default>
</entry>
<entry name="GLVSync" type="Bool">
<default>true</default>
</entry>
<entry name="GLTextureFilter" type="Int">
<default>2</default>
<min>-1</min>

View file

@ -151,7 +151,6 @@ Options::Options(QObject *parent)
, m_hiddenPreviews(Options::defaultHiddenPreviews())
, m_unredirectFullscreen(Options::defaultUnredirectFullscreen())
, m_glSmoothScale(Options::defaultGlSmoothScale())
, m_glVSync(Options::defaultGlVSync())
, m_colorCorrected(Options::defaultColorCorrected())
, m_xrenderSmoothScale(Options::defaultXrenderSmoothScale())
, m_maxFpsInterval(Options::defaultMaxFpsInterval())
@ -679,15 +678,6 @@ void Options::setGlSmoothScale(int glSmoothScale)
emit glSmoothScaleChanged();
}
void Options::setGlVSync(bool glVSync)
{
if (m_glVSync == glVSync) {
return;
}
m_glVSync = glVSync;
emit glVSyncChanged();
}
void Options::setColorCorrected(bool colorCorrected)
{
if (m_colorCorrected == colorCorrected) {
@ -968,7 +958,6 @@ void Options::reloadCompositingSettings(bool force)
KConfigGroup config(_config, "Compositing");
setGlDirect(prefs.enableDirectRendering());
setGlVSync(config.readEntry("GLVSync", Options::defaultGlVSync()));
setGlSmoothScale(qBound(-1, config.readEntry("GLTextureFilter", Options::defaultGlSmoothScale()), 2));
setGlStrictBindingFollowsDriver(!config.hasKey("GLStrictBinding"));
if (!isGlStrictBindingFollowsDriver()) {
@ -977,13 +966,11 @@ void Options::reloadCompositingSettings(bool force)
setGlLegacy(config.readEntry("GLLegacy", Options::defaultGlLegacy()));
char c = 0;
if (isGlVSync()) { // buffer swap enforcement makes little sense without
const QString s = config.readEntry("GLPreferBufferSwap", QString(Options::defaultGlPreferBufferSwap()));
if (!s.isEmpty())
c = s.at(0).toAscii();
if (c != 'a' && c != 'c' && c != 'p' && c != 'e')
c = 0;
}
const QString s = config.readEntry("GLPreferBufferSwap", QString(Options::defaultGlPreferBufferSwap()));
if (!s.isEmpty())
c = s.at(0).toAscii();
if (c != 'a' && c != 'c' && c != 'p' && c != 'e')
c = 0;
setGlPreferBufferSwap(c);
setColorCorrected(config.readEntry("GLColorCorrection", Options::defaultColorCorrected()));

View file

@ -170,7 +170,6 @@ class Options : public QObject, public KDecorationOptions
* -1 = auto
**/
Q_PROPERTY(int glSmoothScale READ glSmoothScale WRITE setGlSmoothScale NOTIFY glSmoothScaleChanged)
Q_PROPERTY(bool glVSync READ isGlVSync WRITE setGlVSync NOTIFY glVSyncChanged)
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)
@ -517,9 +516,6 @@ public:
int glSmoothScale() const {
return m_glSmoothScale;
}
bool isGlVSync() const {
return m_glVSync;
}
bool isColorCorrected() const {
return m_colorCorrected;
}
@ -608,7 +604,6 @@ public:
void setHiddenPreviews(int hiddenPreviews);
void setUnredirectFullscreen(bool unredirectFullscreen);
void setGlSmoothScale(int glSmoothScale);
void setGlVSync(bool glVSync);
void setXrenderSmoothScale(bool xrenderSmoothScale);
void setMaxFpsInterval(uint maxFpsInterval);
void setRefreshRate(uint refreshRate);
@ -692,9 +687,6 @@ public:
static int defaultGlSmoothScale() {
return 2;
}
static bool defaultGlVSync() {
return true;
}
static bool defaultColorCorrected() {
return false;
}
@ -798,7 +790,6 @@ Q_SIGNALS:
void hiddenPreviewsChanged();
void unredirectFullscreenChanged();
void glSmoothScaleChanged();
void glVSyncChanged();
void colorCorrectedChanged();
void xrenderSmoothScaleChanged();
void maxFpsIntervalChanged();
@ -848,7 +839,6 @@ private:
HiddenPreviews m_hiddenPreviews;
bool m_unredirectFullscreen;
int m_glSmoothScale;
bool m_glVSync;
bool m_colorCorrected;
bool m_xrenderSmoothScale;
uint m_maxFpsInterval;