aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcontext.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-03 17:36:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 21:00:00 +0100
commita2e92f6dee12320a58a4bcc95c14649b27804427 (patch)
tree3198365f9f7ca75cc3c4bd23340bb5fe15ee63a5 /src/quick/scenegraph/qsgcontext.cpp
parent337524714cad51934879d817564c5d58e6dbd0c0 (diff)
Dynamic GL in Quick
The counterpart to I716fdebb. Implements the dynamic path in scenegraph. Task-number: QTBUG-36483 Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 9f7818a442..835eeb1c36 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -99,13 +99,8 @@ public:
QSGContextPrivate()
: antialiasingMethod(QSGContext::UndecidedAntialiasing)
, distanceFieldDisabled(qmlDisableDistanceField())
- , distanceFieldAntialiasing(
-#if !defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
- QSGGlyphNode::HighQualitySubPixelAntialiasing
-#else
- QSGGlyphNode::GrayAntialiasing
-#endif
- )
+ , distanceFieldAntialiasing(QSGGlyphNode::HighQualitySubPixelAntialiasing)
+ , distanceFieldAntialiasingDecided(false)
{
}
@@ -117,6 +112,7 @@ public:
QSGContext::AntialiasingMethod antialiasingMethod;
bool distanceFieldDisabled;
QSGDistanceFieldGlyphNode::AntialiasingMode distanceFieldAntialiasing;
+ bool distanceFieldAntialiasingDecided;
static QOpenGLContext *sharedOpenGLContext;
};
@@ -161,6 +157,8 @@ QSGContext::QSGContext(QObject *parent) :
{
Q_D(QSGContext);
QByteArray mode = qgetenv("QSG_DISTANCEFIELD_ANTIALIASING");
+ if (!mode.isEmpty())
+ d->distanceFieldAntialiasingDecided = true;
if (mode == "subpixel")
d->distanceFieldAntialiasing = QSGGlyphNode::HighQualitySubPixelAntialiasing;
else if (mode == "subpixel-lowq")
@@ -212,6 +210,17 @@ void QSGContext::renderContextInitialized(QSGRenderContext *renderContext)
}
}
+ // With OpenGL ES, except for Angle on Windows, use GrayAntialiasing, unless
+ // some value had been requested explicitly. This could not be decided
+ // before without a context. Now the context is ready.
+ if (!d->distanceFieldAntialiasingDecided) {
+ d->distanceFieldAntialiasingDecided = true;
+#ifndef Q_OS_WIN
+ if (renderContext->openglContext()->isES())
+ d->distanceFieldAntialiasing = QSGGlyphNode::GrayAntialiasing;
+#endif
+ }
+
static bool dumped = false;
if (!dumped && qEnvironmentVariableIsSet("QSG_INFO")) {
dumped = true;