diff options
author | Laszlo Agocs <[email protected]> | 2014-06-04 15:05:00 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-06-06 12:25:43 +0200 |
commit | 2e4a40a6ccf466802ea6b3a1cbbd85869228e3fc (patch) | |
tree | a5fc7fc8564df7759155bfb07bf606c66e467e60 /examples/quick | |
parent | 0d3dc8c9e4ee07895c952d48faa55cf4f4b00b7b (diff) |
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 <[email protected]>
Reviewed-by: Gunnar Sletta <[email protected]>
Diffstat (limited to 'examples/quick')
-rw-r--r-- | examples/quick/quickwidgets/quickwidget/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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; |