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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace gfx { | 24 namespace gfx { |
25 class Size; | 25 class Size; |
26 } | 26 } |
27 | 27 |
28 namespace cc { | 28 namespace cc { |
29 | 29 |
30 class BlockingTaskRunner; | 30 class BlockingTaskRunner; |
31 class DirectRenderer; | 31 class DirectRenderer; |
32 class DisplayClient; | 32 class DisplayClient; |
| 33 class DisplayScheduler; |
33 class OutputSurface; | 34 class OutputSurface; |
34 class RendererSettings; | 35 class RendererSettings; |
35 class ResourceProvider; | 36 class ResourceProvider; |
36 class SharedBitmapManager; | 37 class SharedBitmapManager; |
37 class Surface; | 38 class Surface; |
38 class SurfaceAggregator; | 39 class SurfaceAggregator; |
39 class SurfaceIdAllocator; | 40 class SurfaceIdAllocator; |
40 class SurfaceFactory; | 41 class SurfaceFactory; |
41 class TextureMailboxDeleter; | 42 class TextureMailboxDeleter; |
42 | 43 |
43 // A Display produces a surface that can be used to draw to a physical display | 44 // A Display produces a surface that can be used to draw to a physical display |
44 // (OutputSurface). The client is responsible for creating and sizing the | 45 // (OutputSurface). The client is responsible for creating and sizing the |
45 // surface IDs used to draw into the display and deciding when to draw. | 46 // surface IDs used to draw into the display and deciding when to draw. |
46 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, | 47 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, |
47 public RendererClient, | 48 public RendererClient, |
48 public SurfaceDamageObserver { | 49 public SurfaceDamageObserver { |
49 public: | 50 public: |
50 Display(DisplayClient* client, | 51 Display(DisplayClient* client, |
51 SurfaceManager* manager, | 52 SurfaceManager* manager, |
52 SharedBitmapManager* bitmap_manager, | 53 SharedBitmapManager* bitmap_manager, |
53 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 54 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
54 const RendererSettings& settings); | 55 const RendererSettings& settings); |
55 ~Display() override; | 56 ~Display() override; |
56 | 57 |
57 bool Initialize(scoped_ptr<OutputSurface> output_surface); | 58 bool Initialize(scoped_ptr<OutputSurface> output_surface, |
| 59 DisplayScheduler* scheduler); |
58 | 60 |
59 // device_scale_factor is used to communicate to the external window system | 61 // device_scale_factor is used to communicate to the external window system |
60 // what scale this was rendered at. | 62 // what scale this was rendered at. |
61 void SetSurfaceId(SurfaceId id, float device_scale_factor); | 63 void SetSurfaceId(SurfaceId id, float device_scale_factor); |
62 void Resize(const gfx::Size& new_size); | 64 void Resize(const gfx::Size& new_size); |
| 65 bool CurrentSurfaceHasResources(); |
63 bool Draw(); | 66 bool Draw(); |
64 | 67 |
65 SurfaceId CurrentSurfaceId(); | 68 SurfaceId CurrentSurfaceId(); |
66 int GetMaxFramesPending(); | 69 int GetMaxFramesPending(); |
67 | 70 |
68 // OutputSurfaceClient implementation. | 71 // OutputSurfaceClient implementation. |
69 void DeferredInitialize() override {} | 72 void DeferredInitialize() override {} |
70 void ReleaseGL() override {} | 73 void ReleaseGL() override {} |
71 void CommitVSyncParameters(base::TimeTicks timebase, | 74 void CommitVSyncParameters(base::TimeTicks timebase, |
72 base::TimeDelta interval) override; | 75 base::TimeDelta interval) override; |
(...skipping 21 matching lines...) Expand all Loading... |
94 private: | 97 private: |
95 void InitializeRenderer(); | 98 void InitializeRenderer(); |
96 | 99 |
97 DisplayClient* client_; | 100 DisplayClient* client_; |
98 SurfaceManager* manager_; | 101 SurfaceManager* manager_; |
99 SharedBitmapManager* bitmap_manager_; | 102 SharedBitmapManager* bitmap_manager_; |
100 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 103 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
101 RendererSettings settings_; | 104 RendererSettings settings_; |
102 SurfaceId current_surface_id_; | 105 SurfaceId current_surface_id_; |
103 gfx::Size current_surface_size_; | 106 gfx::Size current_surface_size_; |
| 107 bool current_surface_has_resources_; |
104 float device_scale_factor_; | 108 float device_scale_factor_; |
105 scoped_ptr<OutputSurface> output_surface_; | 109 scoped_ptr<OutputSurface> output_surface_; |
| 110 DisplayScheduler* scheduler_; |
106 scoped_ptr<ResourceProvider> resource_provider_; | 111 scoped_ptr<ResourceProvider> resource_provider_; |
107 scoped_ptr<SurfaceAggregator> aggregator_; | 112 scoped_ptr<SurfaceAggregator> aggregator_; |
108 scoped_ptr<DirectRenderer> renderer_; | 113 scoped_ptr<DirectRenderer> renderer_; |
109 scoped_ptr<BlockingTaskRunner> blocking_main_thread_task_runner_; | 114 scoped_ptr<BlockingTaskRunner> blocking_main_thread_task_runner_; |
110 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 115 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
111 std::vector<ui::LatencyInfo> stored_latency_info_; | 116 std::vector<ui::LatencyInfo> stored_latency_info_; |
112 | 117 |
113 DISALLOW_COPY_AND_ASSIGN(Display); | 118 DISALLOW_COPY_AND_ASSIGN(Display); |
114 }; | 119 }; |
115 | 120 |
116 } // namespace cc | 121 } // namespace cc |
117 | 122 |
118 #endif // CC_SURFACES_DISPLAY_H_ | 123 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |