summaryrefslogtreecommitdiffstats
path: root/patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch
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 /patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch
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 'patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch')
-rw-r--r--patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch b/patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch
new file mode 100644
index 000000000..fe63dfc0f
--- /dev/null
+++ b/patches/0001-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch
@@ -0,0 +1,84 @@
+From e40d3482d46ff88755aa2bd76048de698ae03915 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Fri, 20 Sep 2013 15:00:47 +0200
+Subject: [PATCH] Add accessors for the Qt delegated renderer integration.
+
+This is needed to fetch the MessageLoop, the MailboxManager and the
+SyncPointManager of the GPU in-process host.
+---
+ content/common/gpu/gpu_channel_manager.h | 2 ++
+ content/gpu/gpu_child_thread.cc | 6 ++++++
+ content/gpu/gpu_child_thread.h | 6 ++++++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
+index f01a1c5..e41a548 100644
+--- a/content/common/gpu/gpu_channel_manager.h
++++ b/content/common/gpu/gpu_channel_manager.h
+@@ -89,6 +89,8 @@ class GpuChannelManager : public IPC::Listener,
+
+ gpu::gles2::ProgramCache* program_cache();
+
++ gpu::gles2::MailboxManager* mailbox_manager() { return mailbox_manager_.get(); }
++
+ GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; }
+
+ GpuChannel* LookupChannel(int32 client_id);
+diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
+index 170b364..a84a9e0 100644
+--- a/content/gpu/gpu_child_thread.cc
++++ b/content/gpu/gpu_child_thread.cc
+@@ -40,6 +40,8 @@ bool GpuProcessLogMessageHandler(int severity,
+
+ } // namespace
+
++GpuChildThread* GpuChildThread::instance_ = 0;
++
+ GpuChildThread::GpuChildThread(GpuWatchdogThread* watchdog_thread,
+ bool dead_on_arrival,
+ const gpu::GPUInfo& gpu_info,
+@@ -53,6 +55,8 @@ GpuChildThread::GpuChildThread(GpuWatchdogThread* watchdog_thread,
+ target_services_ = NULL;
+ #endif
+ g_thread_safe_sender.Get() = thread_safe_sender();
++
++ instance_ = this;
+ }
+
+ GpuChildThread::GpuChildThread(const std::string& channel_id)
+@@ -71,6 +75,8 @@ GpuChildThread::GpuChildThread(const std::string& channel_id)
+ VLOG(1) << "gfx::GLSurface::InitializeOneOff()";
+ }
+ g_thread_safe_sender.Get() = thread_safe_sender();
++
++ instance_ = this;
+ }
+
+ GpuChildThread::~GpuChildThread() {
+diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h
+index ff0c925..82bb32a 100644
+--- a/content/gpu/gpu_child_thread.h
++++ b/content/gpu/gpu_child_thread.h
+@@ -56,6 +56,10 @@ class GpuChildThread : public ChildThread {
+ virtual bool Send(IPC::Message* msg) OVERRIDE;
+ virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
+
++ GpuChannelManager* ChannelManager() const { return gpu_channel_manager_.get(); }
++
++ static GpuChildThread* instance() { return instance_; }
++
+ private:
+ // Message handlers.
+ void OnInitialize();
+@@ -94,6 +98,8 @@ class GpuChildThread : public ChildThread {
+ // Whether the GPU thread is running in the browser process.
+ bool in_browser_process_;
+
++ static GpuChildThread* instance_;
++
+ DISALLOW_COPY_AND_ASSIGN(GpuChildThread);
+ };
+
+--
+1.8.4.2
+