OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ | 5 #ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ |
6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ | 6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "cc/surfaces/frame_sink_id.h" | 13 #include "cc/surfaces/frame_sink_id.h" |
14 #include "components/viz/service/display_compositor/display_provider.h" | 14 #include "components/viz/service/display_compositor/display_provider.h" |
15 #include "components/viz/service/viz_service_export.h" | 15 #include "components/viz/service/viz_service_export.h" |
16 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 16 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
17 #include "gpu/ipc/common/surface_handle.h" | 17 #include "gpu/ipc/common/surface_handle.h" |
18 #include "gpu/ipc/in_process_command_buffer.h" | 18 #include "gpu/ipc/in_process_command_buffer.h" |
19 | 19 |
20 namespace gpu { | 20 namespace gpu { |
| 21 class GpuChannelManager; |
21 class ImageFactory; | 22 class ImageFactory; |
22 } | 23 } |
23 | 24 |
24 namespace viz { | 25 namespace viz { |
25 | 26 |
26 // In-process implementation of DisplayProvider. | 27 // In-process implementation of DisplayProvider. |
27 class VIZ_SERVICE_EXPORT GpuDisplayProvider | 28 class VIZ_SERVICE_EXPORT GpuDisplayProvider |
28 : public NON_EXPORTED_BASE(DisplayProvider) { | 29 : public NON_EXPORTED_BASE(DisplayProvider) { |
29 public: | 30 public: |
30 GpuDisplayProvider( | 31 GpuDisplayProvider( |
31 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, | 32 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, |
32 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager, | 33 gpu::GpuChannelManager* gpu_channel_manager); |
33 gpu::ImageFactory* image_factory); | |
34 ~GpuDisplayProvider() override; | 34 ~GpuDisplayProvider() override; |
35 | 35 |
36 // DisplayProvider: | 36 // DisplayProvider: |
37 std::unique_ptr<cc::Display> CreateDisplay( | 37 std::unique_ptr<cc::Display> CreateDisplay( |
38 const cc::FrameSinkId& frame_sink_id, | 38 const cc::FrameSinkId& frame_sink_id, |
39 gpu::SurfaceHandle surface_handle, | 39 gpu::SurfaceHandle surface_handle, |
40 std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) override; | 40 std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) override; |
41 | 41 |
42 private: | 42 private: |
43 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; | 43 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; |
44 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; | 44 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; |
45 gpu::ImageFactory* image_factory_; | 45 gpu::ImageFactory* image_factory_; |
46 | 46 |
47 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 47 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(GpuDisplayProvider); | 49 DISALLOW_COPY_AND_ASSIGN(GpuDisplayProvider); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace viz | 52 } // namespace viz |
53 | 53 |
54 #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ | 54 #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_GPU_DISPLAY_PROVIDER_H_ |
OLD | NEW |