OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 virtual void DidActivateSyncTree() = 0; | 112 virtual void DidActivateSyncTree() = 0; |
113 virtual void DidPrepareTiles() = 0; | 113 virtual void DidPrepareTiles() = 0; |
114 | 114 |
115 // Called when page scale animation has completed on the impl thread. | 115 // Called when page scale animation has completed on the impl thread. |
116 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; | 116 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; |
117 | 117 |
118 protected: | 118 protected: |
119 virtual ~LayerTreeHostImplClient() {} | 119 virtual ~LayerTreeHostImplClient() {} |
120 }; | 120 }; |
121 | 121 |
| 122 struct CC_EXPORT FrameData : public RenderPassSink { |
| 123 FrameData(); |
| 124 ~FrameData() override; |
| 125 void AsValueInto(base::trace_event::TracedValue* value) const; |
| 126 |
| 127 std::vector<gfx::Rect> occluding_screen_space_rects; |
| 128 std::vector<gfx::Rect> non_occluding_screen_space_rects; |
| 129 std::vector<FrameTimingTracker::FrameAndRectIds> composite_events; |
| 130 RenderPassList render_passes; |
| 131 RenderPassIdHashMap render_passes_by_id; |
| 132 const LayerImplList* render_surface_layer_list; |
| 133 LayerImplList will_draw_layers; |
| 134 bool has_no_damage; |
| 135 |
| 136 // RenderPassSink implementation. |
| 137 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
| 138 }; |
| 139 |
122 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 140 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
123 // state. | 141 // state. |
124 class CC_EXPORT LayerTreeHostImpl | 142 class CC_EXPORT LayerTreeHostImpl |
125 : public InputHandler, | 143 : public InputHandler, |
126 public RendererClient, | 144 public RendererClient, |
127 public TileManagerClient, | 145 public TileManagerClient, |
128 public OutputSurfaceClient, | 146 public OutputSurfaceClient, |
129 public TopControlsManagerClient, | 147 public TopControlsManagerClient, |
130 public ScrollbarAnimationControllerClient, | 148 public ScrollbarAnimationControllerClient, |
131 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 149 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 196 |
179 // TopControlsManagerClient implementation. | 197 // TopControlsManagerClient implementation. |
180 float TopControlsHeight() const override; | 198 float TopControlsHeight() const override; |
181 void SetCurrentTopControlsShownRatio(float offset) override; | 199 void SetCurrentTopControlsShownRatio(float offset) override; |
182 float CurrentTopControlsShownRatio() const override; | 200 float CurrentTopControlsShownRatio() const override; |
183 void DidChangeTopControlsPosition() override; | 201 void DidChangeTopControlsPosition() override; |
184 bool HaveRootScrollLayer() const override; | 202 bool HaveRootScrollLayer() const override; |
185 | 203 |
186 void UpdateViewportContainerSizes(); | 204 void UpdateViewportContainerSizes(); |
187 | 205 |
188 struct CC_EXPORT FrameData : public RenderPassSink { | |
189 FrameData(); | |
190 ~FrameData() override; | |
191 void AsValueInto(base::trace_event::TracedValue* value) const; | |
192 | |
193 std::vector<gfx::Rect> occluding_screen_space_rects; | |
194 std::vector<gfx::Rect> non_occluding_screen_space_rects; | |
195 std::vector<FrameTimingTracker::FrameAndRectIds> composite_events; | |
196 RenderPassList render_passes; | |
197 RenderPassIdHashMap render_passes_by_id; | |
198 const LayerImplList* render_surface_layer_list; | |
199 LayerImplList will_draw_layers; | |
200 bool has_no_damage; | |
201 | |
202 // RenderPassSink implementation. | |
203 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; | |
204 }; | |
205 | |
206 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 206 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
207 virtual void BeginCommit(); | 207 virtual void BeginCommit(); |
208 virtual void CommitComplete(); | 208 virtual void CommitComplete(); |
209 virtual void Animate(base::TimeTicks monotonic_time); | 209 virtual void Animate(base::TimeTicks monotonic_time); |
210 virtual void UpdateAnimationState(bool start_ready_animations); | 210 virtual void UpdateAnimationState(bool start_ready_animations); |
211 void ActivateAnimations(); | 211 void ActivateAnimations(); |
212 void MainThreadHasStoppedFlinging(); | 212 void MainThreadHasStoppedFlinging(); |
213 void DidAnimateScrollOffset(); | 213 void DidAnimateScrollOffset(); |
214 void SetViewportDamage(const gfx::Rect& damage_rect); | 214 void SetViewportDamage(const gfx::Rect& damage_rect); |
215 | 215 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 bool is_likely_to_require_a_draw_; | 735 bool is_likely_to_require_a_draw_; |
736 | 736 |
737 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 737 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
738 | 738 |
739 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 739 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
740 }; | 740 }; |
741 | 741 |
742 } // namespace cc | 742 } // namespace cc |
743 | 743 |
744 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 744 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |