OLD | NEW |
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 #ifndef SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ | 5 #ifndef SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
6 #define SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ | 6 #define SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
7 | 7 |
| 8 #include "gpu/config/gpu_info.h" |
8 #include "mojo/public/cpp/bindings/binding_set.h" | 9 #include "mojo/public/cpp/bindings/binding_set.h" |
9 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 11 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" |
10 #include "services/ui/public/interfaces/gpu_memory_buffer.mojom.h" | 12 #include "services/ui/public/interfaces/gpu_memory_buffer.mojom.h" |
11 #include "services/ui/public/interfaces/gpu_service.mojom.h" | 13 #include "services/ui/public/interfaces/gpu_service.mojom.h" |
12 | 14 |
13 namespace ui { | 15 namespace ui { |
14 | 16 |
15 class GpuServiceInternal; | 17 class GpuServiceInternal; |
16 | 18 |
17 // The proxy implementation that relays requests from clients to the real | 19 // The proxy implementation that relays requests from clients to the real |
18 // service implementation in the GPU process over mojom.GpuServiceInternal. | 20 // service implementation in the GPU process over mojom.GpuServiceInternal. |
19 class GpuServiceProxy : public mojom::GpuService { | 21 class GpuServiceProxy : public mojom::GpuService { |
20 public: | 22 public: |
21 GpuServiceProxy(); | 23 GpuServiceProxy(); |
22 ~GpuServiceProxy() override; | 24 ~GpuServiceProxy() override; |
23 | 25 |
24 void Add(mojom::GpuServiceRequest request); | 26 void Add(mojom::GpuServiceRequest request); |
25 | 27 |
26 private: | 28 private: |
| 29 void OnInitialized(const gpu::GPUInfo& gpu_info); |
| 30 void OnGpuChannelEstablished(const EstablishGpuChannelCallback& callback, |
| 31 int32_t client_id, |
| 32 mojo::ScopedMessagePipeHandle channel_handle); |
| 33 |
27 // mojom::GpuService overrides: | 34 // mojom::GpuService overrides: |
28 void EstablishGpuChannel( | 35 void EstablishGpuChannel( |
29 const mojom::GpuService::EstablishGpuChannelCallback& callback) override; | 36 const EstablishGpuChannelCallback& callback) override; |
30 | 37 |
31 void CreateGpuMemoryBuffer( | 38 void CreateGpuMemoryBuffer( |
32 mojom::GpuMemoryBufferIdPtr id, | 39 mojom::GpuMemoryBufferIdPtr id, |
33 const gfx::Size& size, | 40 const gfx::Size& size, |
34 gfx::BufferFormat format, | 41 gfx::BufferFormat format, |
35 gfx::BufferUsage usage, | 42 gfx::BufferUsage usage, |
36 uint64_t surface_id, | 43 uint64_t surface_id, |
37 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) | 44 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) |
38 override; | 45 override; |
39 | 46 |
40 void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, | 47 void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, |
41 const gpu::SyncToken& sync_token) override; | 48 const gpu::SyncToken& sync_token) override; |
42 | 49 |
43 GpuServiceInternal* gpu_service_; | 50 int32_t next_client_id_; |
| 51 mojom::GpuServiceInternalPtr gpu_service_; |
44 mojo::BindingSet<GpuService> bindings_; | 52 mojo::BindingSet<GpuService> bindings_; |
| 53 gpu::GPUInfo gpu_info_; |
45 | 54 |
46 DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy); | 55 DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy); |
47 }; | 56 }; |
48 | 57 |
49 } // namespace ui | 58 } // namespace ui |
50 | 59 |
51 #endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ | 60 #endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
OLD | NEW |