summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-10-29 16:21:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-11 17:25:25 +0100
commit7403ef5908cf2d2e81e5cedf44cb2536bd1b9ac2 (patch)
tree80e664cce4b4ff3cfeba0c21eda2a92ca7c339c3 /examples
parent258e3aad97be370663983573b557c4115db3fafb (diff)
Delegated renderer: Put textures on those quads.
A few changes are necessary to allow fetching textures provided by the render processes through IPC and bound to their respective GL context in the GPU process and use them in the QtQuick scene graph. - Remove the plain color test textures. - Allow setting the QtQuick QOpenGLContext's handle as the share context for all context set as shared in the Chromium GPU process. We do this by letting the GpuChannelManager ask us for a ShareGroup instance responsible for returning a sharing GL context handle. - Fetch texture IDs from the MailboxManager used by the GPU process using the Mailbox given to us in the DelegatedFrameData. This is the same mechanism used by Chromium to share textures between "client" GL contexts. - Keep the QtQuick scene graph threads and Chromium in-process GPU thread separate. The complicated part of merging those two rendering pipelines on the same thread is that it would force Qt to also use only one thread for rendering. For the moment we will try to synchronize those threads together instead. - Lock the Qt SG thread while waiting for resource sync points. Do so by posting a callback to the Chromium GPU thread and wait until the sync point of every resource has been retired by the producing contexts. - Acknowledge the delegated from once QtQuick swapped the GL buffers instead of right after we added the frame to the scene graph. This fixes some issues where the textures for the previous frame would already be released as Chromium was producing the new frame. There are still a few issues regarding synchronization that have to be fixed, especially when Qt triggers the rendering of a new frame while Chromium is starting to produce the next frame. Note: To enable it we still need to pass the following command switches: --enable-delegated-renderer --enable-threaded-compositing --in-process-gpu Change-Id: I2d4f7fac603b1808ed1495a8d689cb48e9ed41b9 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/quicknanobrowser/main.cpp8
-rw-r--r--examples/quick/quicknanobrowser/quicknanobrowser.pro2
2 files changed, 10 insertions, 0 deletions
diff --git a/examples/quick/quicknanobrowser/main.cpp b/examples/quick/quicknanobrowser/main.cpp
index 982c1eb7a..6c2f91de6 100644
--- a/examples/quick/quicknanobrowser/main.cpp
+++ b/examples/quick/quicknanobrowser/main.cpp
@@ -47,11 +47,19 @@ typedef QApplication Application;
#include <QtGui/QGuiApplication>
typedef QGuiApplication Application;
#endif
+#include <QtQuick/private/qsgcontext_p.h>
int main(int argc, char **argv)
{
Application app(argc, argv);
+ // This is currently needed by all QtWebEngine application using the HW accelerated QQuickWebView.
+ // It enables sharing between the QOpenGLContext of all QQuickWindows of the application.
+ // We have to do so until we expose a public API for it, or chose enable it by default in Qt 5.3.0.
+ QOpenGLContext shareContext;
+ shareContext.create();
+ QSGContext::setSharedOpenGLContext(&shareContext);
+
ApplicationEngine appEngine;
return app.exec();
diff --git a/examples/quick/quicknanobrowser/quicknanobrowser.pro b/examples/quick/quicknanobrowser/quicknanobrowser.pro
index c32540a71..2132b031a 100644
--- a/examples/quick/quicknanobrowser/quicknanobrowser.pro
+++ b/examples/quick/quicknanobrowser/quicknanobrowser.pro
@@ -12,6 +12,8 @@ RESOURCES += resources.qrc
RESOURCES += ../../common/common_resources.qrc
QT += qml quick
+QT_PRIVATE += quick-private gui-private core-private
+
qtHaveModule(widgets) {
QT += widgets # QApplication is required to get native styling with QtQuickControls
}