Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 1513053002: WIP - Gutterless resize on Windows Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gpu_channel_host.cc
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index 80dfe0a48a074fe5ecd3040dd6a5c9e2361922f6..a398aad329a883a521af06ebf01bfe92a28f07b5 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -22,6 +22,7 @@
#if defined(OS_WIN) || defined(OS_MACOSX)
#include "content/public/common/sandbox_init.h"
+#include "ui/base/window_resize_helper.h"
#endif
using base::AutoLock;
@@ -317,10 +318,26 @@ void GpuChannelHost::AddRoute(
int route_id, base::WeakPtr<IPC::Listener> listener) {
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner =
factory_->GetIOThreadTaskRunner();
+
+#if defined(OS_MACOSX) || defined(OS_WIN)
+ scoped_refptr<base::SingleThreadTaskRunner> thread_task_runner;
+ if (factory_->IsMainThread()) {
+ // If we're adding a route to the main UI thread, we need to use the
+ // WindowResizeHelper's task runner, otherwise Gpu Channel messages will be
+ // blocked during a resize and we won't recieve the swap complete signal.
+ thread_task_runner = ui::WindowResizeHelper::Get()->task_runner();
piman 2015/12/11 07:53:12 This code (GpuChannelHost) is used by both the ren
ericrk 2015/12/15 00:25:03 done - good point - was thinking that was what IsM
+ } else {
+ thread_task_runner = base::ThreadTaskRunnerHandle::Get();
+ }
+#else
+ scoped_refptr<base::SingleThreadTaskRunner> thread_task_runner =
+ base::ThreadTaskRunnerHandle::Get();
+#endif
+
io_task_runner->PostTask(FROM_HERE,
base::Bind(&GpuChannelHost::MessageFilter::AddRoute,
channel_filter_.get(), route_id, listener,
- base::ThreadTaskRunnerHandle::Get()));
+ thread_task_runner));
}
void GpuChannelHost::RemoveRoute(int route_id) {

Powered by Google App Engine
This is Rietveld 408576698