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