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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 1513053002: WIP - Gutterless resize on Windows Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback 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/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 3a385ca6a46dd01f11a5e17b6d92d5f0c9057671..4aa13dc13b243edc37d7b5512e475306de5646cd 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -28,6 +28,7 @@
#include "gpu/command_buffer/service/gpu_switches.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/message_filter.h"
+#include "ui/base/window_resize_helper.h"
namespace content {
@@ -344,6 +345,18 @@ CreateCommandBufferResult BrowserGpuChannelHostFactory::CreateViewCommandBuffer(
return request.result;
}
+scoped_refptr<base::SingleThreadTaskRunner>
+BrowserGpuChannelHostFactory::TaskRunner() {
+#if defined(OS_MACOSX) || defined(OS_WIN)
+ // 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.
+ return ui::WindowResizeHelper::Get()->task_runner();
+#else
+ return base::ThreadTaskRunnerHandle::Get();
+#endif
+}
+
// Blocking the UI thread to open a GPU channel is not supported on Android.
// (Opening the initial channel to a child process involves handling a reply
// task on the UI thread first, so we cannot block here.)

Powered by Google App Engine
This is Rietveld 408576698