Commit b6ef3ba2 authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Pass GpuPreferences to in-process GPU in Mash

GPU service uses GpuPreferences::texture_target_exception_list when
allocating memory buffers for clients. This info needs to be passed to
GPU when it is initialized. Currently, this is not happening in
Multi-Process Mash. This CL passes in this information for in-process
GPU mode which is currently the default mode in Multi-Process Mash.

BUG=906171

Change-Id: I58616db0cba949c3aad8e850aec2c4a8651bab6d
Reviewed-on: https://chromium-review.googlesource.com/c/1342940Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614171}
parent 7038daeb
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//components/ui_devtools/devtools.gni") import("//components/ui_devtools/devtools.gni")
import("//media/gpu/args.gni")
import("//services/catalog/public/tools/catalog.gni") import("//services/catalog/public/tools/catalog.gni")
import("//services/service_manager/public/service_manifest.gni") import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni") import("//testing/test.gni")
...@@ -32,7 +31,6 @@ source_set("main") { ...@@ -32,7 +31,6 @@ source_set("main") {
"//gpu/ipc/common", "//gpu/ipc/common",
"//gpu/ipc/service", "//gpu/ipc/service",
"//ipc", "//ipc",
"//media/gpu:buildflags",
"//mojo/public/cpp/system", "//mojo/public/cpp/system",
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/mojom", "//services/metrics/public/mojom",
...@@ -54,10 +52,6 @@ source_set("main") { ...@@ -54,10 +52,6 @@ source_set("main") {
deps += [ "//media/gpu" ] deps += [ "//media/gpu" ]
} }
if (use_vaapi) {
deps += [ "//media/gpu/vaapi" ]
}
if (use_viz_devtools) { if (use_viz_devtools) {
defines += [ "USE_VIZ_DEVTOOLS" ] defines += [ "USE_VIZ_DEVTOOLS" ]
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "base/command_line.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/power_monitor/power_monitor_device_source.h" #include "base/power_monitor/power_monitor_device_source.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
...@@ -15,9 +14,8 @@ ...@@ -15,9 +14,8 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "components/viz/service/gl/gpu_service_impl.h" #include "components/viz/service/gl/gpu_service_impl.h"
#include "gpu/command_buffer/common/activity_flags.h" #include "gpu/command_buffer/common/activity_flags.h"
#include "gpu/config/gpu_preferences.h"
#include "gpu/config/gpu_switches.h"
#include "gpu/ipc/gpu_in_process_thread_service.h" #include "gpu/ipc/gpu_in_process_thread_service.h"
#include "gpu/ipc/service/gpu_init.h"
#include "gpu/ipc/service/gpu_watchdog_thread.h" #include "gpu/ipc/service/gpu_watchdog_thread.h"
#include "media/gpu/buildflags.h" #include "media/gpu/buildflags.h"
#include "services/metrics/public/cpp/delegating_ukm_recorder.h" #include "services/metrics/public/cpp/delegating_ukm_recorder.h"
...@@ -26,10 +24,6 @@ ...@@ -26,10 +24,6 @@
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#include "third_party/skia/include/core/SkFontLCDConfig.h" #include "third_party/skia/include/core/SkFontLCDConfig.h"
#if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
#include "media/gpu/vaapi/vaapi_wrapper.h"
#endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/ozone_platform.h"
#endif #endif
...@@ -74,6 +68,8 @@ VizMainImpl::VizMainImpl(Delegate* delegate, ...@@ -74,6 +68,8 @@ VizMainImpl::VizMainImpl(Delegate* delegate,
gpu_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), gpu_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
binding_(this), binding_(this),
associated_binding_(this) { associated_binding_(this) {
DCHECK(gpu_init_);
// TODO(crbug.com/609317): Remove this when Mus Window Server and GPU are // TODO(crbug.com/609317): Remove this when Mus Window Server and GPU are
// split into separate processes. Until then this is necessary to be able to // split into separate processes. Until then this is necessary to be able to
// run Mushrome (chrome with mus) with Mus running in the browser process. // run Mushrome (chrome with mus) with Mus running in the browser process.
...@@ -82,32 +78,6 @@ VizMainImpl::VizMainImpl(Delegate* delegate, ...@@ -82,32 +78,6 @@ VizMainImpl::VizMainImpl(Delegate* delegate,
std::make_unique<base::PowerMonitorDeviceSource>()); std::make_unique<base::PowerMonitorDeviceSource>());
} }
if (!gpu_init_) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
gpu::GpuPreferences gpu_preferences;
if (command_line->HasSwitch(switches::kGpuPreferences)) {
std::string value =
command_line->GetSwitchValueASCII(switches::kGpuPreferences);
bool success = gpu_preferences.FromSwitchValue(value);
CHECK(success);
}
#if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
// Initialize media codec. The UI service is running in a priviliged
// process. We don't need care when to initialize media codec. When we have
// a separate GPU (or VIZ) service process, we should initialize them
// before sandboxing
media::VaapiWrapper::PreSandboxInitialization();
#endif
// Initialize GpuInit before starting the IO or compositor threads.
gpu_init_ = std::make_unique<gpu::GpuInit>();
gpu_init_->set_sandbox_helper(this);
// TODO(crbug.com/609317): Use InitializeAndStartSandbox() when gpu-mus is
// split into a separate process.
gpu_init_->InitializeInProcess(command_line, gpu_preferences);
}
if (!dependencies_.io_thread_task_runner) if (!dependencies_.io_thread_task_runner)
io_thread_ = CreateAndStartIOThread(); io_thread_ = CreateAndStartIOThread();
if (dependencies_.create_display_compositor) { if (dependencies_.create_display_compositor) {
...@@ -295,16 +265,4 @@ void VizMainImpl::ExitProcess() { ...@@ -295,16 +265,4 @@ void VizMainImpl::ExitProcess() {
} }
} }
void VizMainImpl::PreSandboxStartup() {
// TODO(sad): https://crbug.com/645602
}
bool VizMainImpl::EnsureSandboxInitialized(
gpu::GpuWatchdogThread* watchdog_thread,
const gpu::GPUInfo* gpu_info,
const gpu::GpuPreferences& gpu_prefs) {
// TODO(sad): https://crbug.com/645602
return true;
}
} // namespace viz } // namespace viz
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "components/discardable_memory/client/client_discardable_shared_memory_manager.h" #include "components/discardable_memory/client/client_discardable_shared_memory_manager.h"
#include "components/viz/service/main/viz_compositor_thread_runner.h" #include "components/viz/service/main/viz_compositor_thread_runner.h"
#include "gpu/ipc/in_process_command_buffer.h" #include "gpu/ipc/in_process_command_buffer.h"
#include "gpu/ipc/service/gpu_init.h"
#include "mojo/public/cpp/bindings/associated_binding_set.h" #include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding.h"
#include "services/viz/privileged/interfaces/gl/gpu_service.mojom.h" #include "services/viz/privileged/interfaces/gl/gpu_service.mojom.h"
...@@ -20,6 +19,7 @@ ...@@ -20,6 +19,7 @@
#include "ui/gfx/font_render_params.h" #include "ui/gfx/font_render_params.h"
namespace gpu { namespace gpu {
class GpuInit;
class SyncPointManager; class SyncPointManager;
} // namespace gpu } // namespace gpu
...@@ -40,7 +40,7 @@ using CompositorThreadType = base::android::JavaHandlerThread; ...@@ -40,7 +40,7 @@ using CompositorThreadType = base::android::JavaHandlerThread;
using CompositorThreadType = base::Thread; using CompositorThreadType = base::Thread;
#endif #endif
class VizMainImpl : public gpu::GpuSandboxHelper, public mojom::VizMain { class VizMainImpl : public mojom::VizMain {
public: public:
struct LogMessage { struct LogMessage {
int severity; int severity;
...@@ -80,7 +80,7 @@ class VizMainImpl : public gpu::GpuSandboxHelper, public mojom::VizMain { ...@@ -80,7 +80,7 @@ class VizMainImpl : public gpu::GpuSandboxHelper, public mojom::VizMain {
VizMainImpl(Delegate* delegate, VizMainImpl(Delegate* delegate,
ExternalDependencies dependencies, ExternalDependencies dependencies,
std::unique_ptr<gpu::GpuInit> gpu_init = nullptr); std::unique_ptr<gpu::GpuInit> gpu_init);
// Destruction must happen on the GPU thread. // Destruction must happen on the GPU thread.
~VizMainImpl() override; ~VizMainImpl() override;
...@@ -119,12 +119,6 @@ class VizMainImpl : public gpu::GpuSandboxHelper, public mojom::VizMain { ...@@ -119,12 +119,6 @@ class VizMainImpl : public gpu::GpuSandboxHelper, public mojom::VizMain {
void CreateFrameSinkManagerInternal(mojom::FrameSinkManagerParamsPtr params); void CreateFrameSinkManagerInternal(mojom::FrameSinkManagerParamsPtr params);
// gpu::GpuSandboxHelper:
void PreSandboxStartup() override;
bool EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread,
const gpu::GPUInfo* gpu_info,
const gpu::GpuPreferences& gpu_prefs) override;
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner() const { scoped_refptr<base::SingleThreadTaskRunner> io_task_runner() const {
return io_thread_ ? io_thread_->task_runner() return io_thread_ ? io_thread_->task_runner()
: dependencies_.io_thread_task_runner; : dependencies_.io_thread_task_runner;
......
include_rules = [ include_rules = [
"+components/viz", "+components/viz",
"+gpu/config",
"+gpu/ipc/service",
"+media/gpu"
] ]
...@@ -4,9 +4,17 @@ ...@@ -4,9 +4,17 @@
#include "services/viz/service.h" #include "services/viz/service.h"
#include "base/command_line.h"
#include "components/viz/service/main/viz_main_impl.h" #include "components/viz/service/main/viz_main_impl.h"
#include "gpu/config/gpu_preferences.h"
#include "gpu/config/gpu_switches.h"
#include "media/gpu/buildflags.h"
#include "services/viz/privileged/interfaces/viz_main.mojom.h" #include "services/viz/privileged/interfaces/viz_main.mojom.h"
#if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
#include "media/gpu/vaapi/vaapi_wrapper.h"
#endif
namespace viz { namespace viz {
Service::Service(service_manager::mojom::ServiceRequest request) Service::Service(service_manager::mojom::ServiceRequest request)
...@@ -19,10 +27,24 @@ void Service::OnStart() { ...@@ -19,10 +27,24 @@ void Service::OnStart() {
registry_.AddInterface<mojom::VizMain>( registry_.AddInterface<mojom::VizMain>(
base::Bind(&Service::BindVizMainRequest, base::Unretained(this))); base::Bind(&Service::BindVizMainRequest, base::Unretained(this)));
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
gpu::GpuPreferences gpu_preferences;
if (command_line->HasSwitch(switches::kGpuPreferences)) {
std::string value =
command_line->GetSwitchValueASCII(switches::kGpuPreferences);
bool success = gpu_preferences.FromSwitchValue(value);
CHECK(success);
}
auto gpu_init = std::make_unique<gpu::GpuInit>();
gpu_init->set_sandbox_helper(this);
gpu_init->InitializeAndStartSandbox(command_line, gpu_preferences);
VizMainImpl::ExternalDependencies deps; VizMainImpl::ExternalDependencies deps;
deps.create_display_compositor = true; deps.create_display_compositor = true;
deps.connector = service_binding_.GetConnector(); deps.connector = service_binding_.GetConnector();
viz_main_ = std::make_unique<VizMainImpl>(nullptr, std::move(deps)); viz_main_ = std::make_unique<VizMainImpl>(nullptr, std::move(deps),
std::move(gpu_init));
} }
void Service::OnBindInterface(const service_manager::BindSourceInfo& info, void Service::OnBindInterface(const service_manager::BindSourceInfo& info,
...@@ -35,4 +57,18 @@ void Service::BindVizMainRequest(mojom::VizMainRequest request) { ...@@ -35,4 +57,18 @@ void Service::BindVizMainRequest(mojom::VizMainRequest request) {
viz_main_->Bind(std::move(request)); viz_main_->Bind(std::move(request));
} }
void Service::PreSandboxStartup() {
#if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
media::VaapiWrapper::PreSandboxInitialization();
#endif
// TODO(sad): https://crbug.com/645602
}
bool Service::EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread,
const gpu::GPUInfo* gpu_info,
const gpu::GpuPreferences& gpu_prefs) {
// TODO(sad): https://crbug.com/645602
return true;
}
} // namespace viz } // namespace viz
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef SERVICES_VIZ_SERVICE_H_ #ifndef SERVICES_VIZ_SERVICE_H_
#define SERVICES_VIZ_SERVICE_H_ #define SERVICES_VIZ_SERVICE_H_
#include "gpu/ipc/service/gpu_init.h"
#include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/service.h" #include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_binding.h" #include "services/service_manager/public/cpp/service_binding.h"
...@@ -15,7 +16,7 @@ namespace viz { ...@@ -15,7 +16,7 @@ namespace viz {
class VizMainImpl; class VizMainImpl;
class Service : public service_manager::Service { class Service : public service_manager::Service, public gpu::GpuSandboxHelper {
public: public:
explicit Service(service_manager::mojom::ServiceRequest request); explicit Service(service_manager::mojom::ServiceRequest request);
~Service() override; ~Service() override;
...@@ -29,6 +30,12 @@ class Service : public service_manager::Service { ...@@ -29,6 +30,12 @@ class Service : public service_manager::Service {
const std::string& interface_name, const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) override; mojo::ScopedMessagePipeHandle interface_pipe) override;
// gpu::GpuSandboxHelper:
void PreSandboxStartup() override;
bool EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread,
const gpu::GPUInfo* gpu_info,
const gpu::GpuPreferences& gpu_prefs) override;
service_manager::ServiceBinding service_binding_; service_manager::ServiceBinding service_binding_;
service_manager::BinderRegistry registry_; service_manager::BinderRegistry registry_;
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//media/gpu/args.gni")
source_set("gpu_host") { source_set("gpu_host") {
sources = [ sources = [
"gpu_host.cc", "gpu_host.cc",
...@@ -14,13 +16,15 @@ source_set("gpu_host") { ...@@ -14,13 +16,15 @@ source_set("gpu_host") {
"//components/discardable_memory/service", "//components/discardable_memory/service",
"//components/viz/common", "//components/viz/common",
"//components/viz/host", "//components/viz/host",
"//components/viz/service/main", # TODO(sad): Temporary until GPU process split. "//components/viz/service/main", # TODO(crbug/912221): Remove after GPU process split.
"//gpu/command_buffer/client", "//gpu/command_buffer/client",
"//gpu/command_buffer/client:gles2_interface", "//gpu/command_buffer/client:gles2_interface",
"//gpu/command_buffer/service", "//gpu/command_buffer/service",
"//gpu/ipc/client", "//gpu/ipc/client",
"//gpu/ipc/common", "//gpu/ipc/common",
"//gpu/ipc/host", "//gpu/ipc/host",
"//gpu/ipc/service", # TODO(crbug/912221): Remove after GPU process split.
"//media/gpu:buildflags",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//mojo/public/cpp/system", "//mojo/public/cpp/system",
"//services/service_manager/public/cpp", "//services/service_manager/public/cpp",
...@@ -41,6 +45,10 @@ source_set("gpu_host") { ...@@ -41,6 +45,10 @@ source_set("gpu_host") {
] ]
} }
if (use_vaapi) {
deps += [ "//media/gpu/vaapi" ]
}
# ui service should not depend on below components. # ui service should not depend on below components.
assert_no_deps = [ assert_no_deps = [
"//ash", "//ash",
......
...@@ -9,6 +9,7 @@ include_rules = [ ...@@ -9,6 +9,7 @@ include_rules = [
"+gpu/ipc/client", "+gpu/ipc/client",
"+gpu/ipc/common", "+gpu/ipc/common",
"+gpu/ipc/host", "+gpu/ipc/host",
"+media/gpu",
"+mojo/public", "+mojo/public",
"+services/viz/privileged/interfaces", "+services/viz/privileged/interfaces",
"+services/viz/public/interfaces", "+services/viz/public/interfaces",
...@@ -18,12 +19,14 @@ include_rules = [ ...@@ -18,12 +19,14 @@ include_rules = [
] ]
specific_include_rules = { specific_include_rules = {
# TODO(crbug.com/620927): This can be removed after ozone-mojo. # TODO(crbug.com/912221): This goes away after the gpu process split in mash.
"gpu_host.h": [ "gpu_host.cc": [
"+components/viz/service/main/viz_main_impl.h", "+components/viz/service/main/viz_main_impl.h",
"+gpu/ipc/service/gpu_init.h",
], ],
"gpu_host_unittest.cc": [ "gpu_host_unittest.cc": [
"+components/viz/service/gl/gpu_service_impl.h", "+components/viz/service/gl/gpu_service_impl.h",
"+gpu/ipc/service/gpu_watchdog_thread.h",
], ],
".*_(unit|pixel|perf)test.*\.cc": [ ".*_(unit|pixel|perf)test.*\.cc": [
"+components/viz/test", "+components/viz/test",
......
...@@ -14,11 +14,15 @@ ...@@ -14,11 +14,15 @@
#include "components/viz/host/gpu_client.h" #include "components/viz/host/gpu_client.h"
#include "components/viz/host/gpu_client_delegate.h" #include "components/viz/host/gpu_client_delegate.h"
#include "components/viz/host/host_gpu_memory_buffer_manager.h" #include "components/viz/host/host_gpu_memory_buffer_manager.h"
#include "components/viz/service/main/viz_main_impl.h"
#include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/config/gpu_preferences.h"
#include "gpu/ipc/client/gpu_channel_host.h" #include "gpu/ipc/client/gpu_channel_host.h"
#include "gpu/ipc/common/gpu_memory_buffer_impl_shared_memory.h" #include "gpu/ipc/common/gpu_memory_buffer_impl_shared_memory.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h"
#include "gpu/ipc/host/shader_disk_cache.h" #include "gpu/ipc/host/shader_disk_cache.h"
#include "gpu/ipc/service/gpu_init.h"
#include "media/gpu/buildflags.h"
#include "mojo/public/cpp/bindings/strong_binding.h" #include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/system/buffer.h" #include "mojo/public/cpp/system/buffer.h"
#include "mojo/public/cpp/system/platform_handle.h" #include "mojo/public/cpp/system/platform_handle.h"
...@@ -37,6 +41,10 @@ ...@@ -37,6 +41,10 @@
#include "services/ws/gpu_host/arc_client.h" #include "services/ws/gpu_host/arc_client.h"
#endif #endif
#if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
#include "media/gpu/vaapi/vaapi_wrapper.h"
#endif
namespace ws { namespace ws {
namespace gpu_host { namespace gpu_host {
...@@ -99,7 +107,8 @@ GpuHost::GpuHost(GpuHostDelegate* delegate, ...@@ -99,7 +107,8 @@ GpuHost::GpuHost(GpuHostDelegate* delegate,
viz::mojom::VizMainPtr viz_main_ptr; viz::mojom::VizMainPtr viz_main_ptr;
if (in_process) { if (in_process) {
// TODO(crbug.com/620927): This should be removed once ozone-mojo is done. // TODO(crbug.com/912221): This goes away after the gpu process split in
// mash.
gpu_thread_.Start(); gpu_thread_.Start();
gpu_thread_.task_runner()->PostTask( gpu_thread_.task_runner()->PostTask(
FROM_HERE, FROM_HERE,
...@@ -145,7 +154,7 @@ GpuHost::GpuHost(GpuHostDelegate* delegate, ...@@ -145,7 +154,7 @@ GpuHost::GpuHost(GpuHostDelegate* delegate,
} }
GpuHost::~GpuHost() { GpuHost::~GpuHost() {
// TODO(crbug.com/620927): This should be removed once ozone-mojo is done. // TODO(crbug.com/912221): This goes away after the gpu process split in mash.
if (gpu_thread_.IsRunning()) { if (gpu_thread_.IsRunning()) {
// Stop() will return after |viz_main_impl_| has been destroyed. // Stop() will return after |viz_main_impl_| has been destroyed.
gpu_thread_.task_runner()->PostTask( gpu_thread_.task_runner()->PostTask(
...@@ -196,9 +205,26 @@ void GpuHost::OnBadMessageFromGpu() { ...@@ -196,9 +205,26 @@ void GpuHost::OnBadMessageFromGpu() {
} }
void GpuHost::InitializeVizMain(viz::mojom::VizMainRequest request) { void GpuHost::InitializeVizMain(viz::mojom::VizMainRequest request) {
gpu::GpuPreferences gpu_preferences;
gpu_preferences.gpu_program_cache_size =
gpu::ShaderDiskCache::CacheSizeBytes();
gpu_preferences.texture_target_exception_list =
gpu::CreateBufferUsageAndFormatExceptionList();
#if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
// Initialize media codec. The UI service is running in a privileged process.
// We don't need care when to initialize media codec.
media::VaapiWrapper::PreSandboxInitialization();
#endif
auto gpu_init = std::make_unique<gpu::GpuInit>();
gpu_init->InitializeInProcess(base::CommandLine::ForCurrentProcess(),
gpu_preferences);
viz::VizMainImpl::ExternalDependencies deps; viz::VizMainImpl::ExternalDependencies deps;
deps.create_display_compositor = true; deps.create_display_compositor = true;
viz_main_impl_ = std::make_unique<viz::VizMainImpl>(nullptr, std::move(deps)); viz_main_impl_ = std::make_unique<viz::VizMainImpl>(nullptr, std::move(deps),
std::move(gpu_init));
viz_main_impl_->Bind(std::move(request)); viz_main_impl_->Bind(std::move(request));
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/viz/host/gpu_host_impl.h" #include "components/viz/host/gpu_host_impl.h"
#include "components/viz/service/main/viz_main_impl.h"
#include "gpu/config/gpu_feature_info.h" #include "gpu/config/gpu_feature_info.h"
#include "gpu/config/gpu_info.h" #include "gpu/config/gpu_info.h"
#include "mojo/public/cpp/bindings/strong_binding_set.h" #include "mojo/public/cpp/bindings/strong_binding_set.h"
...@@ -38,6 +37,7 @@ namespace viz { ...@@ -38,6 +37,7 @@ namespace viz {
class GpuClient; class GpuClient;
class GpuHostImpl; class GpuHostImpl;
class HostGpuMemoryBufferManager; class HostGpuMemoryBufferManager;
class VizMainImpl;
} }
namespace ws { namespace ws {
...@@ -70,7 +70,7 @@ class GpuHost : public viz::GpuHostImpl::Delegate { ...@@ -70,7 +70,7 @@ class GpuHost : public viz::GpuHostImpl::Delegate {
void OnBadMessageFromGpu(); void OnBadMessageFromGpu();
// TODO(crbug.com/611505): this goes away after the gpu process split in mus. // TODO(crbug.com/912221): This goes away after the gpu process split in mash.
void InitializeVizMain(viz::mojom::VizMainRequest request); void InitializeVizMain(viz::mojom::VizMainRequest request);
void DestroyVizMain(); void DestroyVizMain();
...@@ -117,7 +117,7 @@ class GpuHost : public viz::GpuHostImpl::Delegate { ...@@ -117,7 +117,7 @@ class GpuHost : public viz::GpuHostImpl::Delegate {
std::vector<std::unique_ptr<viz::GpuClient>> gpu_clients_; std::vector<std::unique_ptr<viz::GpuClient>> gpu_clients_;
// TODO(crbug.com/620927): This should be removed once ozone-mojo is done. // TODO(crbug.com/912221): This goes away after the gpu process split in mash.
base::Thread gpu_thread_; base::Thread gpu_thread_;
std::unique_ptr<viz::VizMainImpl> viz_main_impl_; std::unique_ptr<viz::VizMainImpl> viz_main_impl_;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "components/viz/service/gl/gpu_service_impl.h" #include "components/viz/service/gl/gpu_service_impl.h"
#include "components/viz/test/gpu_host_impl_test_api.h" #include "components/viz/test/gpu_host_impl_test_api.h"
#include "gpu/config/gpu_info.h" #include "gpu/config/gpu_info.h"
#include "gpu/ipc/service/gpu_watchdog_thread.h"
#include "services/ws/gpu_host/gpu_host_delegate.h" #include "services/ws/gpu_host/gpu_host_delegate.h"
#include "services/ws/gpu_host/gpu_host_test_api.h" #include "services/ws/gpu_host/gpu_host_test_api.h"
#include "services/ws/public/mojom/gpu.mojom.h" #include "services/ws/public/mojom/gpu.mojom.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment