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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 std::unique_ptr<OutputSurface> output_surface, | 65 std::unique_ptr<OutputSurface> output_surface, |
66 std::unique_ptr<DisplayScheduler> scheduler, | 66 std::unique_ptr<DisplayScheduler> scheduler, |
67 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); | 67 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); |
68 | 68 |
69 ~Display() override; | 69 ~Display() override; |
70 | 70 |
71 void Initialize(DisplayClient* client); | 71 void Initialize(DisplayClient* client); |
72 | 72 |
73 // device_scale_factor is used to communicate to the external window system | 73 // device_scale_factor is used to communicate to the external window system |
74 // what scale this was rendered at. | 74 // what scale this was rendered at. |
75 void SetSurfaceId(SurfaceId id, float device_scale_factor); | 75 void SetSurfaceId(const SurfaceId& id, float device_scale_factor); |
76 void Resize(const gfx::Size& new_size); | 76 void Resize(const gfx::Size& new_size); |
77 void SetColorSpace(const gfx::ColorSpace& color_space); | 77 void SetColorSpace(const gfx::ColorSpace& color_space); |
78 void SetExternalClip(const gfx::Rect& clip); | 78 void SetExternalClip(const gfx::Rect& clip); |
79 void SetOutputIsSecure(bool secure); | 79 void SetOutputIsSecure(bool secure); |
80 | 80 |
81 SurfaceId CurrentSurfaceId(); | 81 const SurfaceId& CurrentSurfaceId(); |
82 | 82 |
83 // DisplaySchedulerClient implementation. | 83 // DisplaySchedulerClient implementation. |
84 bool DrawAndSwap() override; | 84 bool DrawAndSwap() override; |
85 | 85 |
86 // OutputSurfaceClient implementation. | 86 // OutputSurfaceClient implementation. |
87 void CommitVSyncParameters(base::TimeTicks timebase, | 87 void CommitVSyncParameters(base::TimeTicks timebase, |
88 base::TimeDelta interval) override; | 88 base::TimeDelta interval) override; |
89 void SetBeginFrameSource(BeginFrameSource* source) override; | 89 void SetBeginFrameSource(BeginFrameSource* source) override; |
90 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; | 90 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; |
91 void DidSwapBuffers() override; | 91 void DidSwapBuffers() override; |
92 void DidSwapBuffersComplete() override; | 92 void DidSwapBuffersComplete() override; |
93 void DidReceiveTextureInUseResponses( | 93 void DidReceiveTextureInUseResponses( |
94 const gpu::TextureInUseResponses& responses) override; | 94 const gpu::TextureInUseResponses& responses) override; |
95 void ReclaimResources(const CompositorFrameAck* ack) override; | 95 void ReclaimResources(const CompositorFrameAck* ack) override; |
96 void DidLoseOutputSurface() override; | 96 void DidLoseOutputSurface() override; |
97 void SetExternalTilePriorityConstraints( | 97 void SetExternalTilePriorityConstraints( |
98 const gfx::Rect& viewport_rect, | 98 const gfx::Rect& viewport_rect, |
99 const gfx::Transform& transform) override; | 99 const gfx::Transform& transform) override; |
100 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 100 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
101 void SetTreeActivationCallback(const base::Closure& callback) override; | 101 void SetTreeActivationCallback(const base::Closure& callback) override; |
102 void OnDraw(const gfx::Transform& transform, | 102 void OnDraw(const gfx::Transform& transform, |
103 const gfx::Rect& viewport, | 103 const gfx::Rect& viewport, |
104 const gfx::Rect& clip, | 104 const gfx::Rect& clip, |
105 bool resourceless_software_draw) override; | 105 bool resourceless_software_draw) override; |
106 | 106 |
107 // RendererClient implementation. | 107 // RendererClient implementation. |
108 void SetFullRootLayerDamage() override; | 108 void SetFullRootLayerDamage() override; |
109 | 109 |
110 // SurfaceDamageObserver implementation. | 110 // SurfaceDamageObserver implementation. |
111 void OnSurfaceDamaged(SurfaceId surface, bool* changed) override; | 111 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; |
112 | 112 |
113 void SetEnlargePassTextureAmountForTesting( | 113 void SetEnlargePassTextureAmountForTesting( |
114 const gfx::Size& enlarge_texture_amount) { | 114 const gfx::Size& enlarge_texture_amount) { |
115 enlarge_texture_amount_ = enlarge_texture_amount; | 115 enlarge_texture_amount_ = enlarge_texture_amount; |
116 } | 116 } |
117 | 117 |
118 private: | 118 private: |
119 void InitializeRenderer(); | 119 void InitializeRenderer(); |
120 void UpdateRootSurfaceResourcesLocked(); | 120 void UpdateRootSurfaceResourcesLocked(); |
121 | 121 |
(...skipping 24 matching lines...) Expand all Loading... |
146 SoftwareRenderer* software_renderer_ = nullptr; | 146 SoftwareRenderer* software_renderer_ = nullptr; |
147 std::vector<ui::LatencyInfo> stored_latency_info_; | 147 std::vector<ui::LatencyInfo> stored_latency_info_; |
148 | 148 |
149 private: | 149 private: |
150 DISALLOW_COPY_AND_ASSIGN(Display); | 150 DISALLOW_COPY_AND_ASSIGN(Display); |
151 }; | 151 }; |
152 | 152 |
153 } // namespace cc | 153 } // namespace cc |
154 | 154 |
155 #endif // CC_SURFACES_DISPLAY_H_ | 155 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |