From 2e4a40a6ccf466802ea6b3a1cbbd85869228e3fc Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 4 Jun 2014 15:05:00 +0200 Subject: Add support for multisampling in QQuickWidget Use a multisampled fbo when the requested format has samples > 0. Resolving happens after each rendering of the scene. The blit to the temporary non-multisampled fbo could be avoided, in theory, by sending the fbo instead of the texture id down the stack and performing a blit directly to fbo #0. This however involves a number of potential issues, for example due to the non-sharability of FBOs between contexts. Hence it is left as a future exercise. Task-number: QTBUG-39187 Change-Id: Iae98b969bcbc3bb57e6d73288496f5428913c826 Reviewed-by: Paul Olav Tvete Reviewed-by: Gunnar Sletta --- examples/quick/quickwidgets/quickwidget/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/quick/quickwidgets/quickwidget') diff --git a/examples/quick/quickwidgets/quickwidget/main.cpp b/examples/quick/quickwidgets/quickwidget/main.cpp index 61c54735cf..3850dde157 100644 --- a/examples/quick/quickwidgets/quickwidget/main.cpp +++ b/examples/quick/quickwidgets/quickwidget/main.cpp @@ -58,12 +58,14 @@ private: MainWindow::MainWindow() : m_quickWidget(new QQuickWidget) { + QSurfaceFormat format; if (QCoreApplication::arguments().contains(QStringLiteral("--coreprofile"))) { - QSurfaceFormat format; format.setVersion(4, 4); format.setProfile(QSurfaceFormat::CoreProfile); - m_quickWidget->setFormat(format); } + if (QCoreApplication::arguments().contains(QStringLiteral("--multisample"))) + format.setSamples(4); + m_quickWidget->setFormat(format); QMdiArea *centralWidget = new QMdiArea; -- cgit v1.2.3