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 <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class SurfaceAggregator; | 44 class SurfaceAggregator; |
45 class SurfaceIdAllocator; | 45 class SurfaceIdAllocator; |
46 class SurfaceFactory; | 46 class SurfaceFactory; |
47 class TextureMailboxDeleter; | 47 class TextureMailboxDeleter; |
48 | 48 |
49 // A Display produces a surface that can be used to draw to a physical display | 49 // A Display produces a surface that can be used to draw to a physical display |
50 // (OutputSurface). The client is responsible for creating and sizing the | 50 // (OutputSurface). The client is responsible for creating and sizing the |
51 // surface IDs used to draw into the display and deciding when to draw. | 51 // surface IDs used to draw into the display and deciding when to draw. |
52 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, | 52 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, |
53 public OutputSurfaceClient, | 53 public OutputSurfaceClient, |
54 public RendererClient, | |
55 public SurfaceDamageObserver { | 54 public SurfaceDamageObserver { |
56 public: | 55 public: |
57 // The |begin_frame_source| and |scheduler| may be null (together). In that | 56 // The |begin_frame_source| and |scheduler| may be null (together). In that |
58 // case, DrawAndSwap must be called externally when needed. | 57 // case, DrawAndSwap must be called externally when needed. |
59 Display(SharedBitmapManager* bitmap_manager, | 58 Display(SharedBitmapManager* bitmap_manager, |
60 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 59 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
61 const RendererSettings& settings, | 60 const RendererSettings& settings, |
62 std::unique_ptr<BeginFrameSource> begin_frame_source, | 61 std::unique_ptr<BeginFrameSource> begin_frame_source, |
63 std::unique_ptr<OutputSurface> output_surface, | 62 std::unique_ptr<OutputSurface> output_surface, |
64 std::unique_ptr<DisplayScheduler> scheduler, | 63 std::unique_ptr<DisplayScheduler> scheduler, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void DidLoseOutputSurface() override; | 96 void DidLoseOutputSurface() override; |
98 void SetExternalTilePriorityConstraints( | 97 void SetExternalTilePriorityConstraints( |
99 const gfx::Rect& viewport_rect, | 98 const gfx::Rect& viewport_rect, |
100 const gfx::Transform& transform) override; | 99 const gfx::Transform& transform) override; |
101 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 100 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
102 void SetTreeActivationCallback(const base::Closure& callback) override; | 101 void SetTreeActivationCallback(const base::Closure& callback) override; |
103 void OnDraw(const gfx::Transform& transform, | 102 void OnDraw(const gfx::Transform& transform, |
104 const gfx::Rect& viewport, | 103 const gfx::Rect& viewport, |
105 bool resourceless_software_draw) override; | 104 bool resourceless_software_draw) override; |
106 | 105 |
107 // RendererClient implementation. | |
108 void SetFullRootLayerDamage() override; | |
109 | |
110 // SurfaceDamageObserver implementation. | 106 // SurfaceDamageObserver implementation. |
111 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; | 107 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; |
112 | 108 |
113 void SetEnlargePassTextureAmountForTesting( | 109 void SetEnlargePassTextureAmountForTesting( |
114 const gfx::Size& enlarge_texture_amount) { | 110 const gfx::Size& enlarge_texture_amount) { |
115 enlarge_texture_amount_ = enlarge_texture_amount; | 111 enlarge_texture_amount_ = enlarge_texture_amount; |
116 } | 112 } |
117 | 113 |
118 bool has_scheduler() const { return !!scheduler_; } | 114 bool has_scheduler() const { return !!scheduler_; } |
119 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } | 115 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 SoftwareRenderer* software_renderer_ = nullptr; | 150 SoftwareRenderer* software_renderer_ = nullptr; |
155 std::vector<ui::LatencyInfo> stored_latency_info_; | 151 std::vector<ui::LatencyInfo> stored_latency_info_; |
156 | 152 |
157 private: | 153 private: |
158 DISALLOW_COPY_AND_ASSIGN(Display); | 154 DISALLOW_COPY_AND_ASSIGN(Display); |
159 }; | 155 }; |
160 | 156 |
161 } // namespace cc | 157 } // namespace cc |
162 | 158 |
163 #endif // CC_SURFACES_DISPLAY_H_ | 159 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |