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

View File

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

View File

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

View File

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