summaryrefslogtreecommitdiffstats
path: root/tests/qmlcamera/main.cpp
diff options
context:
space:
mode:
authorKera╠łnen Pasi <pasi.keranen@digia.com>2013-12-16 16:17:07 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-12-17 12:52:03 +0200
commitfba185e6c2fa5158aa60ba4468c1f1a70177f77a (patch)
tree4532ce4cc96fc52a32410f552e8557ea68d98267 /tests/qmlcamera/main.cpp
parent018379d522deca3a6f7b184fbc12f122a87aaadc (diff)
Antialiasing and direct rendering with QML.
Task-id: QTRD-2565 Change-Id: I4099c869f157361ee6a900dfc1c29301b373ac30 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'tests/qmlcamera/main.cpp')
-rw-r--r--tests/qmlcamera/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/qmlcamera/main.cpp b/tests/qmlcamera/main.cpp
index 90d81eab..146e91fa 100644
--- a/tests/qmlcamera/main.cpp
+++ b/tests/qmlcamera/main.cpp
@@ -24,6 +24,19 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QtQuick2ApplicationViewer viewer;
+
+ // Enable antialiasing
+ QSurfaceFormat surfaceFormat;
+ surfaceFormat.setDepthBufferSize(24);
+#if !defined(QT_OPENGL_ES_2)
+ surfaceFormat.setSamples(8);
+ surfaceFormat.setRenderableType(QSurfaceFormat::OpenGL);
+#else
+ surfaceFormat.setRenderableType(QSurfaceFormat::OpenGLES);
+#endif
+ surfaceFormat.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+ viewer.setFormat(surfaceFormat);
+
#ifdef Q_OS_ANDROID
viewer.addImportPath(QString::fromLatin1("assets:/qml"));
viewer.engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(),