OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_SURFACES_DISPLAY_H_ | 5 #ifndef CC_SURFACES_DISPLAY_H_ |
6 #define CC_SURFACES_DISPLAY_H_ | 6 #define CC_SURFACES_DISPLAY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "cc/output/output_surface_client.h" | 11 #include "cc/output/output_surface_client.h" |
12 #include "cc/output/renderer.h" | 12 #include "cc/output/renderer.h" |
13 #include "cc/resources/returned_resource.h" | 13 #include "cc/resources/returned_resource.h" |
14 #include "cc/surfaces/surface_aggregator.h" | 14 #include "cc/surfaces/surface_aggregator.h" |
15 #include "cc/surfaces/surface_id.h" | 15 #include "cc/surfaces/surface_id.h" |
16 #include "cc/surfaces/surface_manager.h" | 16 #include "cc/surfaces/surface_manager.h" |
17 #include "cc/surfaces/surfaces_export.h" | 17 #include "cc/surfaces/surfaces_export.h" |
18 | 18 |
19 namespace gfx { | 19 namespace gfx { |
20 class Size; | 20 class Size; |
21 } | 21 } |
22 | 22 |
23 namespace cc { | 23 namespace cc { |
24 | 24 |
25 class BlockingTaskRunner; | 25 class BlockingTaskRunner; |
26 class DirectRenderer; | 26 class DirectRenderer; |
27 class DisplayClient; | 27 class DisplayClient; |
| 28 class DisplayScheduler; |
28 class OutputSurface; | 29 class OutputSurface; |
29 class RendererSettings; | 30 class RendererSettings; |
30 class ResourceProvider; | 31 class ResourceProvider; |
31 class SharedBitmapManager; | 32 class SharedBitmapManager; |
32 class Surface; | 33 class Surface; |
33 class SurfaceAggregator; | 34 class SurfaceAggregator; |
34 class SurfaceIdAllocator; | 35 class SurfaceIdAllocator; |
35 class SurfaceFactory; | 36 class SurfaceFactory; |
36 class TextureMailboxDeleter; | 37 class TextureMailboxDeleter; |
37 | 38 |
38 // A Display produces a surface that can be used to draw to a physical display | 39 // A Display produces a surface that can be used to draw to a physical display |
39 // (OutputSurface). The client is responsible for creating and sizing the | 40 // (OutputSurface). The client is responsible for creating and sizing the |
40 // surface IDs used to draw into the display and deciding when to draw. | 41 // surface IDs used to draw into the display and deciding when to draw. |
41 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, | 42 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, |
42 public RendererClient, | 43 public RendererClient, |
43 public SurfaceDamageObserver { | 44 public SurfaceDamageObserver { |
44 public: | 45 public: |
45 Display(DisplayClient* client, | 46 Display(DisplayClient* client, |
46 SurfaceManager* manager, | 47 SurfaceManager* manager, |
47 SharedBitmapManager* bitmap_manager, | 48 SharedBitmapManager* bitmap_manager, |
48 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 49 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
49 const RendererSettings& settings); | 50 const RendererSettings& settings); |
50 ~Display() override; | 51 ~Display() override; |
51 | 52 |
52 bool Initialize(scoped_ptr<OutputSurface> output_surface); | 53 bool Initialize(scoped_ptr<OutputSurface> output_surface, |
| 54 DisplayScheduler* scheduler); |
53 | 55 |
54 // device_scale_factor is used to communicate to the external window system | 56 // device_scale_factor is used to communicate to the external window system |
55 // what scale this was rendered at. | 57 // what scale this was rendered at. |
56 void SetSurfaceId(SurfaceId id, float device_scale_factor); | 58 void SetSurfaceId(SurfaceId id, float device_scale_factor); |
57 void Resize(const gfx::Size& new_size); | 59 void Resize(const gfx::Size& new_size); |
58 bool Draw(); | 60 bool Draw(); |
59 | 61 |
60 SurfaceId CurrentSurfaceId(); | 62 SurfaceId CurrentSurfaceId(); |
61 int GetMaxFramesPending(); | 63 int GetMaxFramesPending(); |
62 | 64 |
(...skipping 28 matching lines...) Expand all Loading... |
91 | 93 |
92 DisplayClient* client_; | 94 DisplayClient* client_; |
93 SurfaceManager* manager_; | 95 SurfaceManager* manager_; |
94 SharedBitmapManager* bitmap_manager_; | 96 SharedBitmapManager* bitmap_manager_; |
95 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 97 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
96 RendererSettings settings_; | 98 RendererSettings settings_; |
97 SurfaceId current_surface_id_; | 99 SurfaceId current_surface_id_; |
98 gfx::Size current_surface_size_; | 100 gfx::Size current_surface_size_; |
99 float device_scale_factor_; | 101 float device_scale_factor_; |
100 scoped_ptr<OutputSurface> output_surface_; | 102 scoped_ptr<OutputSurface> output_surface_; |
| 103 DisplayScheduler* scheduler_; |
101 scoped_ptr<ResourceProvider> resource_provider_; | 104 scoped_ptr<ResourceProvider> resource_provider_; |
102 scoped_ptr<SurfaceAggregator> aggregator_; | 105 scoped_ptr<SurfaceAggregator> aggregator_; |
103 scoped_ptr<DirectRenderer> renderer_; | 106 scoped_ptr<DirectRenderer> renderer_; |
104 scoped_ptr<BlockingTaskRunner> blocking_main_thread_task_runner_; | 107 scoped_ptr<BlockingTaskRunner> blocking_main_thread_task_runner_; |
105 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 108 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
106 std::vector<ui::LatencyInfo> stored_latency_info_; | 109 std::vector<ui::LatencyInfo> stored_latency_info_; |
107 | 110 |
108 DISALLOW_COPY_AND_ASSIGN(Display); | 111 DISALLOW_COPY_AND_ASSIGN(Display); |
109 }; | 112 }; |
110 | 113 |
111 } // namespace cc | 114 } // namespace cc |
112 | 115 |
113 #endif // CC_SURFACES_DISPLAY_H_ | 116 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |