| 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 "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "gpu/config/gpu_info.h" | 11 #include "gpu/config/gpu_info.h" |
| 12 #include "gpu/ipc/client/gpu_channel_host.h" | 12 #include "gpu/ipc/client/gpu_channel_host.h" |
| 13 #include "mojo/public/cpp/bindings/binding_set.h" | 13 #include "mojo/public/cpp/bindings/binding_set.h" |
| 14 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
| 15 #include "services/ui/gpu/gpu_main.h" | 15 #include "services/ui/gpu/gpu_main.h" |
| 16 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" | 16 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" |
| 17 #include "services/ui/public/interfaces/gpu_service.mojom.h" | 17 #include "services/ui/public/interfaces/gpu_service.mojom.h" |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 | 20 |
| 21 class MusGpuMemoryBufferManager; | 21 class ServerGpuMemoryBufferManager; |
| 22 | 22 |
| 23 namespace ws { | 23 namespace ws { |
| 24 | 24 |
| 25 class GpuServiceProxyDelegate; | 25 class GpuServiceProxyDelegate; |
| 26 | 26 |
| 27 // Sets up connection from clients to the real service implementation in the GPU | 27 // Sets up connection from clients to the real service implementation in the GPU |
| 28 // process. | 28 // process. |
| 29 class GpuServiceProxy { | 29 class GpuServiceProxy { |
| 30 public: | 30 public: |
| 31 explicit GpuServiceProxy(GpuServiceProxyDelegate* delegate); | 31 explicit GpuServiceProxy(GpuServiceProxyDelegate* delegate); |
| 32 ~GpuServiceProxy(); | 32 ~GpuServiceProxy(); |
| 33 | 33 |
| 34 void Add(mojom::GpuServiceRequest request); | 34 void Add(mojom::GpuServiceRequest request); |
| 35 | 35 |
| 36 // Requests a cc::mojom::DisplayCompositor interface from mus-gpu. | 36 // Requests a cc::mojom::DisplayCompositor interface from mus-gpu. |
| 37 void CreateDisplayCompositor(cc::mojom::DisplayCompositorRequest request, | 37 void CreateDisplayCompositor(cc::mojom::DisplayCompositorRequest request, |
| 38 cc::mojom::DisplayCompositorClientPtr client); | 38 cc::mojom::DisplayCompositorClientPtr client); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 void OnInitialized(const gpu::GPUInfo& gpu_info); | 41 void OnInitialized(const gpu::GPUInfo& gpu_info); |
| 42 | 42 |
| 43 GpuServiceProxyDelegate* const delegate_; | 43 GpuServiceProxyDelegate* const delegate_; |
| 44 int32_t next_client_id_; | 44 int32_t next_client_id_; |
| 45 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 45 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 46 mojom::GpuServiceInternalPtr gpu_service_; | 46 mojom::GpuServiceInternalPtr gpu_service_; |
| 47 gpu::GPUInfo gpu_info_; | 47 gpu::GPUInfo gpu_info_; |
| 48 std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 48 std::unique_ptr<ServerGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 49 | 49 |
| 50 mojom::GpuMainPtr gpu_main_; | 50 mojom::GpuMainPtr gpu_main_; |
| 51 | 51 |
| 52 // TODO(fsamuel): GpuServiceProxy should not be holding onto |gpu_main_impl| | 52 // TODO(fsamuel): GpuServiceProxy should not be holding onto |gpu_main_impl| |
| 53 // because that will live in another process soon. | 53 // because that will live in another process soon. |
| 54 std::unique_ptr<GpuMain> gpu_main_impl_; | 54 std::unique_ptr<GpuMain> gpu_main_impl_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy); | 56 DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace ws | 59 } // namespace ws |
| 60 } // namespace ui | 60 } // namespace ui |
| 61 | 61 |
| 62 #endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ | 62 #endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
| OLD | NEW |