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

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

Issue 2612623002: gpu: Use mus gpu interface in non-mus chrome. (Closed)
Patch Set: more cleanup Created 3 years, 11 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/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 0a77951fb62ab1d833c6cb43a434785bacdc547b..0966386a2c552ad0d07faa615b78b1da86914425 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -461,7 +461,8 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind)
swiftshader_rendering_(false),
kind_(kind),
process_launched_(false),
- initialized_(false) {
+ initialized_(false),
+ gpu_host_binding_(this) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess) ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -619,9 +620,10 @@ bool GpuProcessHost::Init() {
process_->child_channel()
->GetAssociatedInterfaceSupport()
->GetRemoteAssociatedInterface(&gpu_main_ptr_);
-
- if (!Send(new GpuMsg_Initialize(gpu_preferences)))
- return false;
+ ui::mojom::GpuServiceRequest request(&gpu_service_ptr_);
+ gpu_main_ptr_->CreateGpuService(std::move(request),
+ gpu_host_binding_.CreateInterfacePtrAndBind(),
+ gpu_preferences);
#if defined(USE_OZONE)
// Ozone needs to send the primary DRM device to GPU process as early as
@@ -676,17 +678,6 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyingVideoSurfaceAck,
OnDestroyingVideoSurfaceAck)
#endif
- IPC_MESSAGE_HANDLER(GpuHostMsg_DidCreateOffscreenContext,
- OnDidCreateOffscreenContext)
- IPC_MESSAGE_HANDLER(GpuHostMsg_DidLoseContext, OnDidLoseContext)
- IPC_MESSAGE_HANDLER(GpuHostMsg_DidDestroyOffscreenContext,
- OnDidDestroyOffscreenContext)
- IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyChannel, OnDestroyChannel)
- IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader, OnCacheShader)
-#if defined(OS_WIN)
- IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow,
- OnAcceleratedSurfaceCreatedChildWindow)
-#endif
IPC_MESSAGE_HANDLER(GpuHostMsg_FieldTrialActivated, OnFieldTrialActivated);
IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message))
IPC_END_MESSAGE_MAP()
@@ -963,6 +954,41 @@ void GpuProcessHost::OnProcessCrashed(int exit_code) {
process_->GetTerminationStatus(true /* known_dead */, NULL));
}
+void GpuProcessHost::DidInitialize(const gpu::GPUInfo& gpu_info) {
+ // TODO(sad): This should call OnInitialized().
+}
+
+void GpuProcessHost::DidCreateOffscreenContext(const GURL& url) {
+ OnDidCreateOffscreenContext(url);
sadrul 2017/01/21 05:35:56 Note that I have deliberately kept the old ipc-mes
+}
+
+void GpuProcessHost::DidDestroyOffscreenContext(const GURL& url) {
+ OnDidDestroyOffscreenContext(url);
+}
+
+void GpuProcessHost::DidDestroyChannel(int32_t client_id) {
+ OnDestroyChannel(client_id);
+}
+
+void GpuProcessHost::DidLoseContext(bool offscreen,
+ gpu::error::ContextLostReason reason,
+ const GURL& active_url) {
+ OnDidLoseContext(offscreen, reason, active_url);
+}
+
+void GpuProcessHost::SetChildSurface(gpu::SurfaceHandle parent,
+ gpu::SurfaceHandle child) {
+#if defined(OS_WIN)
+ OnAcceleratedSurfaceCreatedChildWindow(parent, child);
+#endif
+}
+
+void GpuProcessHost::StoreShaderToDisk(int32_t client_id,
+ const std::string& key,
+ const std::string& shader) {
+ OnCacheShader(client_id, key, shader);
+}
+
GpuProcessHost::GpuProcessKind GpuProcessHost::kind() {
return kind_;
}

Powered by Google App Engine
This is Rietveld 408576698