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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // A Display produces a surface that can be used to draw to a physical display | 35 // 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 | 36 // (OutputSurface). The client is responsible for creating and sizing the |
37 // surface IDs used to draw into the display and deciding when to draw. | 37 // surface IDs used to draw into the display and deciding when to draw. |
38 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, | 38 class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, |
39 public RendererClient, | 39 public RendererClient, |
40 public SurfaceDamageObserver { | 40 public SurfaceDamageObserver { |
41 public: | 41 public: |
42 Display(DisplayClient* client, | 42 Display(DisplayClient* client, |
43 SurfaceManager* manager, | 43 SurfaceManager* manager, |
44 SharedBitmapManager* bitmap_manager, | 44 SharedBitmapManager* bitmap_manager, |
45 GpuMemoryBufferManager* gpu_memory_buffer_manager); | 45 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
46 ~Display() override; | 46 ~Display() override; |
47 | 47 |
48 bool Initialize(scoped_ptr<OutputSurface> output_surface); | 48 bool Initialize(scoped_ptr<OutputSurface> output_surface); |
49 void Resize(SurfaceId id, const gfx::Size& new_size); | 49 void Resize(SurfaceId id, const gfx::Size& new_size); |
50 bool Draw(); | 50 bool Draw(); |
51 | 51 |
52 SurfaceId CurrentSurfaceId(); | 52 SurfaceId CurrentSurfaceId(); |
53 int GetMaxFramesPending(); | 53 int GetMaxFramesPending(); |
54 | 54 |
55 // OutputSurfaceClient implementation. | 55 // OutputSurfaceClient implementation. |
(...skipping 22 matching lines...) Expand all Loading... |
78 | 78 |
79 // SurfaceDamageObserver implementation. | 79 // SurfaceDamageObserver implementation. |
80 void OnSurfaceDamaged(SurfaceId surface) override; | 80 void OnSurfaceDamaged(SurfaceId surface) override; |
81 | 81 |
82 private: | 82 private: |
83 void InitializeRenderer(); | 83 void InitializeRenderer(); |
84 | 84 |
85 DisplayClient* client_; | 85 DisplayClient* client_; |
86 SurfaceManager* manager_; | 86 SurfaceManager* manager_; |
87 SharedBitmapManager* bitmap_manager_; | 87 SharedBitmapManager* bitmap_manager_; |
88 GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 88 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
89 SurfaceId current_surface_id_; | 89 SurfaceId current_surface_id_; |
90 gfx::Size current_surface_size_; | 90 gfx::Size current_surface_size_; |
91 LayerTreeSettings settings_; | 91 LayerTreeSettings settings_; |
92 scoped_ptr<OutputSurface> output_surface_; | 92 scoped_ptr<OutputSurface> output_surface_; |
93 scoped_ptr<ResourceProvider> resource_provider_; | 93 scoped_ptr<ResourceProvider> resource_provider_; |
94 scoped_ptr<SurfaceAggregator> aggregator_; | 94 scoped_ptr<SurfaceAggregator> aggregator_; |
95 scoped_ptr<DirectRenderer> renderer_; | 95 scoped_ptr<DirectRenderer> renderer_; |
96 scoped_ptr<BlockingTaskRunner> blocking_main_thread_task_runner_; | 96 scoped_ptr<BlockingTaskRunner> blocking_main_thread_task_runner_; |
97 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 97 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(Display); | 99 DISALLOW_COPY_AND_ASSIGN(Display); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace cc | 102 } // namespace cc |
103 | 103 |
104 #endif // CC_SURFACES_DISPLAY_H_ | 104 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |