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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 1231263003: Share SyncPointManager between ipc and in-process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 months 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/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index dc399e05fbdd9c0f0cfdfa3ef37f69f8dedafa68..9377cd76e1c4380c2363898f3f363f91816df365 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -15,6 +15,7 @@
#include "content/gpu/gpu_watchdog_thread.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "gpu/command_buffer/service/sync_point_manager.h"
#include "gpu/config/gpu_info_collector.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_sync_message_filter.h"
@@ -119,6 +120,8 @@ GpuChildThread::GpuChildThread(
GpuMemoryBufferFactory* gpu_memory_buffer_factory)
: ChildThreadImpl(GetOptions(gpu_memory_buffer_factory)),
dead_on_arrival_(dead_on_arrival),
+ sync_point_manager_(new gpu::SyncPointManager(false)),
+ sync_point_manager_ptr_(sync_point_manager_.get()),
gpu_info_(gpu_info),
deferred_messages_(deferred_messages),
in_browser_process_(false),
@@ -132,13 +135,20 @@ GpuChildThread::GpuChildThread(
GpuChildThread::GpuChildThread(
const InProcessChildThreadParams& params,
- GpuMemoryBufferFactory* gpu_memory_buffer_factory)
+ GpuMemoryBufferFactory* gpu_memory_buffer_factory,
+ gpu::SyncPointManager* sync_point_manager_override)
: ChildThreadImpl(ChildThreadImpl::Options::Builder()
.InBrowserProcess(params)
.AddStartupFilter(new GpuMemoryBufferMessageFilter(
gpu_memory_buffer_factory))
.Build()),
dead_on_arrival_(false),
+ sync_point_manager_(sync_point_manager_override
+ ? nullptr
+ : new gpu::SyncPointManager(false)),
+ sync_point_manager_ptr_(sync_point_manager_override
+ ? sync_point_manager_override
+ : sync_point_manager_.get()),
in_browser_process_(true),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory) {
#if defined(OS_WIN)
@@ -245,7 +255,8 @@ void GpuChildThread::OnInitialize() {
GetRouter(), watchdog_thread_.get(),
ChildProcess::current()->io_task_runner(),
ChildProcess::current()->GetShutDownEvent(), channel(),
- GetAttachmentBroker(), gpu_memory_buffer_factory_));
+ GetAttachmentBroker(), sync_point_manager_ptr_,
+ gpu_memory_buffer_factory_));
#if defined(USE_OZONE)
ui::OzonePlatform::GetInstance()

Powered by Google App Engine
This is Rietveld 408576698