diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-01-15 11:46:57 +0100 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-01-15 11:48:47 +0100 |
commit | 314b0e75bdcd9579149364d9ec76fc1591736f32 (patch) | |
tree | 11f07b738e5b8055da8c2c475414b3896b135fc0 | |
parent | ac2783136030bae18a33b3543ef68474b504cac2 (diff) |
Make multisampling and defaultSurfaceFormat opt-in
Change-Id: I13922fb3367ab1ac427e3b874147fbfcaa45227b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
-rw-r--r-- | customcontext/context.cpp | 5 | ||||
-rw-r--r-- | customcontext/context.h | 2 | ||||
-rw-r--r-- | customcontext/customcontext.pro | 7 |
3 files changed, 12 insertions, 2 deletions
diff --git a/customcontext/context.cpp b/customcontext/context.cpp index c6ff7db..45cce7f 100644 --- a/customcontext/context.cpp +++ b/customcontext/context.cpp @@ -91,7 +91,7 @@ Context::Context(QObject *parent) , m_sampleCount(0) , m_useMultisampling(false) { - m_useMultisampling = qgetenv("CUSTOMCONTEXT_NO_MULTISAMPLE").isEmpty(); + m_useMultisampling = !qgetenv("CUSTOMCONTEXT_MULTISAMPLE").isEmpty(); if (m_useMultisampling) { m_sampleCount= 16; QByteArray overrideSamples = qgetenv("CUSTOMCONTEXT_MULTISAMPLE_COUNT"); @@ -312,7 +312,7 @@ void Context::invalidate() } - +#ifdef CUSTOMCONTEXT_SURFACEFORMAT QSurfaceFormat Context::defaultSurfaceFormat() const { QSurfaceFormat format; @@ -323,6 +323,7 @@ QSurfaceFormat Context::defaultSurfaceFormat() const format.setSamples(m_sampleCount); return format; } +#endif diff --git a/customcontext/context.h b/customcontext/context.h index 2addd26..8dbd025 100644 --- a/customcontext/context.h +++ b/customcontext/context.h @@ -76,7 +76,9 @@ public: QAnimationDriver *createAnimationDriver(QObject *parent); QSGRenderer *createRenderer(); +#ifdef CUSTOMCONTEXT_SURFACEFORMAT QSurfaceFormat defaultSurfaceFormat() const; +#endif QSGTexture *createTexture(const QImage &image) const; QQuickTextureFactory *createTextureFactory(const QImage &image); diff --git a/customcontext/customcontext.pro b/customcontext/customcontext.pro index 1d4a467..6675dc0 100644 --- a/customcontext/customcontext.pro +++ b/customcontext/customcontext.pro @@ -16,6 +16,7 @@ verbose:{ + ############################################################ # # Rendering hooks @@ -146,6 +147,12 @@ msaa:{ message("msaa .....................: no") } +surfaceformat:{ + message("surfaceformat ............: yes") + DEFINES += CUSTOMCONTEXT_SURFACEFORMAT +} else { + message("surfaceformat ............: no") +} message(""); |