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 <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 116 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
117 public: | 117 public: |
118 static scoped_ptr<LayerTreeHostImpl> Create( | 118 static scoped_ptr<LayerTreeHostImpl> Create( |
119 const LayerTreeSettings& settings, | 119 const LayerTreeSettings& settings, |
120 LayerTreeHostImplClient* client, | 120 LayerTreeHostImplClient* client, |
121 Proxy* proxy, | 121 Proxy* proxy, |
122 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 122 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
123 SharedBitmapManager* shared_bitmap_manager, | 123 SharedBitmapManager* shared_bitmap_manager, |
124 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 124 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
125 int id); | 125 int id); |
126 virtual ~LayerTreeHostImpl(); | 126 ~LayerTreeHostImpl() override; |
127 | 127 |
128 // BeginFrameSourceMixIn implementation | 128 // BeginFrameSourceMixIn implementation |
129 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | 129 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
130 | 130 |
131 // InputHandler implementation | 131 // InputHandler implementation |
132 virtual void BindToClient(InputHandlerClient* client) override; | 132 void BindToClient(InputHandlerClient* client) override; |
133 virtual InputHandler::ScrollStatus ScrollBegin( | 133 InputHandler::ScrollStatus ScrollBegin( |
134 const gfx::Point& viewport_point, | 134 const gfx::Point& viewport_point, |
135 InputHandler::ScrollInputType type) override; | 135 InputHandler::ScrollInputType type) override; |
136 virtual InputHandler::ScrollStatus ScrollAnimated( | 136 InputHandler::ScrollStatus ScrollAnimated( |
137 const gfx::Point& viewport_point, | 137 const gfx::Point& viewport_point, |
138 const gfx::Vector2dF& scroll_delta) override; | 138 const gfx::Vector2dF& scroll_delta) override; |
139 virtual bool ScrollBy(const gfx::Point& viewport_point, | 139 bool ScrollBy(const gfx::Point& viewport_point, |
140 const gfx::Vector2dF& scroll_delta) override; | 140 const gfx::Vector2dF& scroll_delta) override; |
141 virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point, | 141 bool ScrollVerticallyByPage(const gfx::Point& viewport_point, |
142 ScrollDirection direction) override; | 142 ScrollDirection direction) override; |
143 virtual void SetRootLayerScrollOffsetDelegate( | 143 void SetRootLayerScrollOffsetDelegate( |
144 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; | 144 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; |
145 virtual void OnRootLayerDelegatedScrollOffsetChanged() override; | 145 void OnRootLayerDelegatedScrollOffsetChanged() override; |
146 virtual void ScrollEnd() override; | 146 void ScrollEnd() override; |
147 virtual InputHandler::ScrollStatus FlingScrollBegin() override; | 147 InputHandler::ScrollStatus FlingScrollBegin() override; |
148 virtual void MouseMoveAt(const gfx::Point& viewport_point) override; | 148 void MouseMoveAt(const gfx::Point& viewport_point) override; |
149 virtual void PinchGestureBegin() override; | 149 void PinchGestureBegin() override; |
150 virtual void PinchGestureUpdate(float magnify_delta, | 150 void PinchGestureUpdate(float magnify_delta, |
151 const gfx::Point& anchor) override; | 151 const gfx::Point& anchor) override; |
152 virtual void PinchGestureEnd() override; | 152 void PinchGestureEnd() override; |
153 virtual void SetNeedsAnimate() override; | 153 void SetNeedsAnimate() override; |
154 virtual bool IsCurrentlyScrollingLayerAt( | 154 bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, |
155 const gfx::Point& viewport_point, | 155 InputHandler::ScrollInputType type) override; |
156 InputHandler::ScrollInputType type) override; | 156 bool HaveTouchEventHandlersAt(const gfx::Point& viewport_port) override; |
157 virtual bool HaveTouchEventHandlersAt( | 157 scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
158 const gfx::Point& viewport_port) override; | |
159 virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( | |
160 ui::LatencyInfo* latency) override; | 158 ui::LatencyInfo* latency) override; |
161 | 159 |
162 // TopControlsManagerClient implementation. | 160 // TopControlsManagerClient implementation. |
163 virtual void SetControlsTopOffset(float offset) override; | 161 void SetControlsTopOffset(float offset) override; |
164 virtual float ControlsTopOffset() const override; | 162 float ControlsTopOffset() const override; |
165 virtual void DidChangeTopControlsPosition() override; | 163 void DidChangeTopControlsPosition() override; |
166 virtual bool HaveRootScrollLayer() const override; | 164 bool HaveRootScrollLayer() const override; |
167 | 165 |
168 struct CC_EXPORT FrameData : public RenderPassSink { | 166 struct CC_EXPORT FrameData : public RenderPassSink { |
169 FrameData(); | 167 FrameData(); |
170 virtual ~FrameData(); | 168 ~FrameData() override; |
171 void AsValueInto(base::debug::TracedValue* value) const; | 169 void AsValueInto(base::debug::TracedValue* value) const; |
172 | 170 |
173 std::vector<gfx::Rect> occluding_screen_space_rects; | 171 std::vector<gfx::Rect> occluding_screen_space_rects; |
174 std::vector<gfx::Rect> non_occluding_screen_space_rects; | 172 std::vector<gfx::Rect> non_occluding_screen_space_rects; |
175 RenderPassList render_passes; | 173 RenderPassList render_passes; |
176 RenderPassIdHashMap render_passes_by_id; | 174 RenderPassIdHashMap render_passes_by_id; |
177 const LayerImplList* render_surface_layer_list; | 175 const LayerImplList* render_surface_layer_list; |
178 LayerImplList will_draw_layers; | 176 LayerImplList will_draw_layers; |
179 bool contains_incomplete_tile; | 177 bool contains_incomplete_tile; |
180 bool has_no_damage; | 178 bool has_no_damage; |
181 | 179 |
182 // RenderPassSink implementation. | 180 // RenderPassSink implementation. |
183 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; | 181 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
184 }; | 182 }; |
185 | 183 |
186 virtual void BeginMainFrameAborted(bool did_handle); | 184 virtual void BeginMainFrameAborted(bool did_handle); |
187 virtual void BeginCommit(); | 185 virtual void BeginCommit(); |
188 virtual void CommitComplete(); | 186 virtual void CommitComplete(); |
189 virtual void Animate(base::TimeTicks monotonic_time); | 187 virtual void Animate(base::TimeTicks monotonic_time); |
190 virtual void UpdateAnimationState(bool start_ready_animations); | 188 virtual void UpdateAnimationState(bool start_ready_animations); |
191 void ActivateAnimations(); | 189 void ActivateAnimations(); |
192 void MainThreadHasStoppedFlinging(); | 190 void MainThreadHasStoppedFlinging(); |
193 void UpdateBackgroundAnimateTicking(bool should_background_tick); | 191 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 DrawMode GetDrawMode() const; | 223 DrawMode GetDrawMode() const; |
226 | 224 |
227 // Viewport size in draw space: this size is in physical pixels and is used | 225 // Viewport size in draw space: this size is in physical pixels and is used |
228 // for draw properties, tilings, quads and render passes. | 226 // for draw properties, tilings, quads and render passes. |
229 gfx::Size DrawViewportSize() const; | 227 gfx::Size DrawViewportSize() const; |
230 | 228 |
231 // Viewport rect in view space used for tiling prioritization. | 229 // Viewport rect in view space used for tiling prioritization. |
232 const gfx::Rect ViewportRectForTilePriority() const; | 230 const gfx::Rect ViewportRectForTilePriority() const; |
233 | 231 |
234 // RendererClient implementation. | 232 // RendererClient implementation. |
235 virtual void SetFullRootLayerDamage() override; | 233 void SetFullRootLayerDamage() override; |
236 | 234 |
237 // TileManagerClient implementation. | 235 // TileManagerClient implementation. |
238 virtual const std::vector<PictureLayerImpl*>& GetPictureLayers() | 236 const std::vector<PictureLayerImpl*>& GetPictureLayers() const override; |
239 const override; | 237 void NotifyReadyToActivate() override; |
240 virtual void NotifyReadyToActivate() override; | 238 void NotifyTileStateChanged(const Tile* tile) override; |
241 virtual void NotifyTileStateChanged(const Tile* tile) override; | 239 void BuildRasterQueue(RasterTilePriorityQueue* queue, |
242 virtual void BuildRasterQueue(RasterTilePriorityQueue* queue, | 240 TreePriority tree_priority) override; |
243 TreePriority tree_priority) override; | 241 void BuildEvictionQueue(EvictionTilePriorityQueue* queue, |
244 virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue, | 242 TreePriority tree_priority) override; |
245 TreePriority tree_priority) override; | |
246 | 243 |
247 // ScrollbarAnimationControllerClient implementation. | 244 // ScrollbarAnimationControllerClient implementation. |
248 virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, | 245 void PostDelayedScrollbarFade(const base::Closure& start_fade, |
249 base::TimeDelta delay) override; | 246 base::TimeDelta delay) override; |
250 virtual void SetNeedsScrollbarAnimationFrame() override; | 247 void SetNeedsScrollbarAnimationFrame() override; |
251 | 248 |
252 // OutputSurfaceClient implementation. | 249 // OutputSurfaceClient implementation. |
253 virtual void DeferredInitialize() override; | 250 void DeferredInitialize() override; |
254 virtual void ReleaseGL() override; | 251 void ReleaseGL() override; |
255 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 252 void CommitVSyncParameters(base::TimeTicks timebase, |
256 base::TimeDelta interval) override; | 253 base::TimeDelta interval) override; |
257 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 254 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
258 virtual void BeginFrame(const BeginFrameArgs& args) override; | 255 void BeginFrame(const BeginFrameArgs& args) override; |
259 | 256 |
260 virtual void SetExternalDrawConstraints( | 257 void SetExternalDrawConstraints( |
261 const gfx::Transform& transform, | 258 const gfx::Transform& transform, |
262 const gfx::Rect& viewport, | 259 const gfx::Rect& viewport, |
263 const gfx::Rect& clip, | 260 const gfx::Rect& clip, |
264 const gfx::Rect& viewport_rect_for_tile_priority, | 261 const gfx::Rect& viewport_rect_for_tile_priority, |
265 const gfx::Transform& transform_for_tile_priority, | 262 const gfx::Transform& transform_for_tile_priority, |
266 bool resourceless_software_draw) override; | 263 bool resourceless_software_draw) override; |
267 virtual void DidLoseOutputSurface() override; | 264 void DidLoseOutputSurface() override; |
268 virtual void DidSwapBuffers() override; | 265 void DidSwapBuffers() override; |
269 virtual void DidSwapBuffersComplete() override; | 266 void DidSwapBuffersComplete() override; |
270 virtual void ReclaimResources(const CompositorFrameAck* ack) override; | 267 void ReclaimResources(const CompositorFrameAck* ack) override; |
271 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 268 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
272 virtual void SetTreeActivationCallback(const base::Closure& callback) | 269 void SetTreeActivationCallback(const base::Closure& callback) override; |
273 override; | |
274 | 270 |
275 // Called from LayerTreeImpl. | 271 // Called from LayerTreeImpl. |
276 void OnCanDrawStateChangedForTree(); | 272 void OnCanDrawStateChangedForTree(); |
277 | 273 |
278 // Implementation. | 274 // Implementation. |
279 int id() const { return id_; } | 275 int id() const { return id_; } |
280 bool CanDraw() const; | 276 bool CanDraw() const; |
281 OutputSurface* output_surface() const { return output_surface_.get(); } | 277 OutputSurface* output_surface() const { return output_surface_.get(); } |
282 | 278 |
283 std::string LayerTreeAsJson() const; | 279 std::string LayerTreeAsJson() const; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 418 |
423 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 419 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
424 void ResetCurrentBeginFrameArgsForNextFrame(); | 420 void ResetCurrentBeginFrameArgsForNextFrame(); |
425 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 421 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
426 | 422 |
427 // Expected time between two begin impl frame calls. | 423 // Expected time between two begin impl frame calls. |
428 base::TimeDelta begin_impl_frame_interval() const { | 424 base::TimeDelta begin_impl_frame_interval() const { |
429 return begin_impl_frame_interval_; | 425 return begin_impl_frame_interval_; |
430 } | 426 } |
431 | 427 |
432 virtual void AsValueInto(base::debug::TracedValue* value) const override; | 428 void AsValueInto(base::debug::TracedValue* value) const override; |
433 void AsValueWithFrameInto(FrameData* frame, | 429 void AsValueWithFrameInto(FrameData* frame, |
434 base::debug::TracedValue* value) const; | 430 base::debug::TracedValue* value) const; |
435 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 431 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
436 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 432 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
437 FrameData* frame) const; | 433 FrameData* frame) const; |
438 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 434 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
439 const; | 435 const; |
440 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 436 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
441 | 437 |
442 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 438 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 710 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
715 | 711 |
716 bool requires_high_res_to_draw_; | 712 bool requires_high_res_to_draw_; |
717 | 713 |
718 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 714 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
719 }; | 715 }; |
720 | 716 |
721 } // namespace cc | 717 } // namespace cc |
722 | 718 |
723 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 719 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |