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

Side by Side Diff: services/ui/ws/gpu_service_proxy.cc

Issue 2559113002: mus/gpu: Introduce the GpuServiceHost mojom interface. (Closed)
Patch Set: . Created 4 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/gpu_service_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/gpu_service_proxy.h" 5 #include "services/ui/ws/gpu_service_proxy.h"
6 6
7 #include "base/memory/shared_memory.h" 7 #include "base/memory/shared_memory.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 mojom::GpuServiceInternal* gpu_service_internal_; 91 mojom::GpuServiceInternal* gpu_service_internal_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(GpuServiceImpl); 93 DISALLOW_COPY_AND_ASSIGN(GpuServiceImpl);
94 }; 94 };
95 95
96 } // namespace 96 } // namespace
97 97
98 GpuServiceProxy::GpuServiceProxy(GpuServiceProxyDelegate* delegate) 98 GpuServiceProxy::GpuServiceProxy(GpuServiceProxyDelegate* delegate)
99 : delegate_(delegate), 99 : delegate_(delegate),
100 next_client_id_(kInternalGpuChannelClientId + 1), 100 next_client_id_(kInternalGpuChannelClientId + 1),
101 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()) { 101 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
102 gpu_host_binding_(this) {
102 gpu_main_impl_ = base::MakeUnique<GpuMain>(GetProxy(&gpu_main_)); 103 gpu_main_impl_ = base::MakeUnique<GpuMain>(GetProxy(&gpu_main_));
103 gpu_main_impl_->OnStart(); 104 gpu_main_impl_->OnStart();
104 // TODO(sad): Once GPU process is split, this would look like: 105 // TODO(sad): Once GPU process is split, this would look like:
105 // connector->ConnectToInterface("gpu", &gpu_main_); 106 // connector->ConnectToInterface("gpu", &gpu_main_);
106 gpu_main_->CreateGpuService( 107 gpu_main_->CreateGpuService(GetProxy(&gpu_service_),
107 GetProxy(&gpu_service_), 108 gpu_host_binding_.CreateInterfacePtrAndBind());
108 base::Bind(&GpuServiceProxy::OnInitialized, base::Unretained(this)));
109 gpu_memory_buffer_manager_ = base::MakeUnique<MusGpuMemoryBufferManager>( 109 gpu_memory_buffer_manager_ = base::MakeUnique<MusGpuMemoryBufferManager>(
110 gpu_service_.get(), next_client_id_++); 110 gpu_service_.get(), next_client_id_++);
111 } 111 }
112 112
113 GpuServiceProxy::~GpuServiceProxy() { 113 GpuServiceProxy::~GpuServiceProxy() {
114 } 114 }
115 115
116 void GpuServiceProxy::Add(mojom::GpuServiceRequest request) { 116 void GpuServiceProxy::Add(mojom::GpuServiceRequest request) {
117 mojo::MakeStrongBinding( 117 mojo::MakeStrongBinding(
118 base::MakeUnique<GpuServiceImpl>(next_client_id_++, &gpu_info_, 118 base::MakeUnique<GpuServiceImpl>(next_client_id_++, &gpu_info_,
119 gpu_memory_buffer_manager_.get(), 119 gpu_memory_buffer_manager_.get(),
120 gpu_service_.get()), 120 gpu_service_.get()),
121 std::move(request)); 121 std::move(request));
122 } 122 }
123 123
124 void GpuServiceProxy::CreateDisplayCompositor( 124 void GpuServiceProxy::CreateDisplayCompositor(
125 cc::mojom::DisplayCompositorRequest request, 125 cc::mojom::DisplayCompositorRequest request,
126 cc::mojom::DisplayCompositorClientPtr client) { 126 cc::mojom::DisplayCompositorClientPtr client) {
127 gpu_main_->CreateDisplayCompositor(std::move(request), std::move(client)); 127 gpu_main_->CreateDisplayCompositor(std::move(request), std::move(client));
128 } 128 }
129 129
130 void GpuServiceProxy::OnInitialized(const gpu::GPUInfo& gpu_info) { 130 void GpuServiceProxy::DidInitialize(const gpu::GPUInfo& gpu_info) {
131 gpu_info_ = gpu_info; 131 gpu_info_ = gpu_info;
132 delegate_->OnGpuServiceInitialized(); 132 delegate_->OnGpuServiceInitialized();
133 } 133 }
134 134
135 void GpuServiceProxy::DidCreateOffscreenContext(const GURL& url) {}
136
137 void GpuServiceProxy::DidDestroyOffscreenContext(const GURL& url) {}
138
139 void GpuServiceProxy::DidDestroyChannel(int32_t client_id) {}
140
141 void GpuServiceProxy::DidLoseContext(bool offscreen,
142 gpu::error::ContextLostReason reason,
143 const GURL& active_url) {}
144
145 void GpuServiceProxy::StoreShaderToDisk(int32_t client_id,
146 const std::string& key,
147 const std::string& shader) {}
148
135 } // namespace ws 149 } // namespace ws
136 } // namespace ui 150 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/gpu_service_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698