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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 public: | 58 public: |
59 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 59 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
60 virtual void OnSwapBuffersCompleteOnImplThread() = 0; | 60 virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
61 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0; | 61 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0; |
62 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 62 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
63 virtual void NotifyReadyToActivate() = 0; | 63 virtual void NotifyReadyToActivate() = 0; |
64 virtual void SetNeedsRedrawOnImplThread() = 0; | 64 virtual void SetNeedsRedrawOnImplThread() = 0; |
65 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; | 65 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; |
66 virtual void DidInitializeVisibleTileOnImplThread() = 0; | 66 virtual void DidInitializeVisibleTileOnImplThread() = 0; |
67 virtual void SetNeedsCommitOnImplThread() = 0; | 67 virtual void SetNeedsCommitOnImplThread() = 0; |
| 68 virtual void SetNeedsManageTilesOnImplThread() = 0; |
68 virtual void PostAnimationEventsToMainThreadOnImplThread( | 69 virtual void PostAnimationEventsToMainThreadOnImplThread( |
69 scoped_ptr<AnimationEventsVector> events, | 70 scoped_ptr<AnimationEventsVector> events, |
70 base::Time wall_clock_time) = 0; | 71 base::Time wall_clock_time) = 0; |
71 // Returns true if resources were deleted by this call. | 72 // Returns true if resources were deleted by this call. |
72 virtual bool ReduceContentsTextureMemoryOnImplThread( | 73 virtual bool ReduceContentsTextureMemoryOnImplThread( |
73 size_t limit_bytes, | 74 size_t limit_bytes, |
74 int priority_cutoff) = 0; | 75 int priority_cutoff) = 0; |
75 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; | 76 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; |
76 virtual void SendManagedMemoryStats() = 0; | 77 virtual void SendManagedMemoryStats() = 0; |
77 virtual bool IsInsideDraw() = 0; | 78 virtual bool IsInsideDraw() = 0; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 156 |
156 virtual void BeginCommit(); | 157 virtual void BeginCommit(); |
157 virtual void CommitComplete(); | 158 virtual void CommitComplete(); |
158 virtual void Animate(base::TimeTicks monotonic_time, | 159 virtual void Animate(base::TimeTicks monotonic_time, |
159 base::Time wall_clock_time); | 160 base::Time wall_clock_time); |
160 virtual void UpdateAnimationState(bool start_ready_animations); | 161 virtual void UpdateAnimationState(bool start_ready_animations); |
161 void MainThreadHasStoppedFlinging(); | 162 void MainThreadHasStoppedFlinging(); |
162 void UpdateBackgroundAnimateTicking(bool should_background_tick); | 163 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
163 void SetViewportDamage(gfx::Rect damage_rect); | 164 void SetViewportDamage(gfx::Rect damage_rect); |
164 | 165 |
165 void ManageTiles(); | 166 virtual void ManageTiles(); |
166 | 167 |
167 // Returns false if problems occured preparing the frame, and we should try | 168 // Returns false if problems occured preparing the frame, and we should try |
168 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers | 169 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
169 // must also be called, regardless of whether DrawLayers is called between the | 170 // must also be called, regardless of whether DrawLayers is called between the |
170 // two. | 171 // two. |
171 virtual bool PrepareToDraw(FrameData* frame, | 172 virtual bool PrepareToDraw(FrameData* frame, |
172 gfx::Rect device_viewport_damage_rect); | 173 gfx::Rect device_viewport_damage_rect); |
173 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 174 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
174 // Must be called if and only if PrepareToDraw was called. | 175 // Must be called if and only if PrepareToDraw was called. |
175 void DidDrawAllLayers(const FrameData& frame); | 176 void DidDrawAllLayers(const FrameData& frame); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 int SourceAnimationFrameNumber() const; | 248 int SourceAnimationFrameNumber() const; |
248 | 249 |
249 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); | 250 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
250 bool IsContextLost(); | 251 bool IsContextLost(); |
251 TileManager* tile_manager() { return tile_manager_.get(); } | 252 TileManager* tile_manager() { return tile_manager_.get(); } |
252 Renderer* renderer() { return renderer_.get(); } | 253 Renderer* renderer() { return renderer_.get(); } |
253 const RendererCapabilities& GetRendererCapabilities() const; | 254 const RendererCapabilities& GetRendererCapabilities() const; |
254 | 255 |
255 virtual bool SwapBuffers(const FrameData& frame); | 256 virtual bool SwapBuffers(const FrameData& frame); |
256 void SetNeedsBeginFrame(bool enable); | 257 void SetNeedsBeginFrame(bool enable); |
257 void SetNeedsManageTiles() { manage_tiles_needed_ = true; } | 258 void DidModifyTilePriorities(); |
258 | 259 |
259 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); | 260 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); |
260 | 261 |
261 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 262 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
262 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 263 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
263 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 264 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
264 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 265 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
265 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 266 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
266 virtual void CreatePendingTree(); | 267 virtual void CreatePendingTree(); |
267 virtual void UpdateVisibleTiles(); | 268 virtual void UpdateVisibleTiles(); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 base::Time wall_clock_time); | 422 base::Time wall_clock_time); |
422 | 423 |
423 // Virtual for testing. | 424 // Virtual for testing. |
424 virtual base::TimeDelta LowFrequencyAnimationInterval() const; | 425 virtual base::TimeDelta LowFrequencyAnimationInterval() const; |
425 | 426 |
426 const AnimationRegistrar::AnimationControllerMap& | 427 const AnimationRegistrar::AnimationControllerMap& |
427 active_animation_controllers() const { | 428 active_animation_controllers() const { |
428 return animation_registrar_->active_animation_controllers(); | 429 return animation_registrar_->active_animation_controllers(); |
429 } | 430 } |
430 | 431 |
431 bool manage_tiles_needed() const { return manage_tiles_needed_; } | 432 bool manage_tiles_needed() const { return tile_priorities_dirty_; } |
432 | 433 |
433 LayerTreeHostImplClient* client_; | 434 LayerTreeHostImplClient* client_; |
434 Proxy* proxy_; | 435 Proxy* proxy_; |
435 | 436 |
436 private: | 437 private: |
437 void CreateAndSetRenderer( | 438 void CreateAndSetRenderer( |
438 OutputSurface* output_surface, | 439 OutputSurface* output_surface, |
439 ResourceProvider* resource_provider, | 440 ResourceProvider* resource_provider, |
440 bool skip_gl_renderer); | 441 bool skip_gl_renderer); |
441 void CreateAndSetTileManager(ResourceProvider* resource_provider, | 442 void CreateAndSetTileManager(ResourceProvider* resource_provider, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 512 |
512 // In impl-side painting mode, inert tree with layers that can be recycled | 513 // In impl-side painting mode, inert tree with layers that can be recycled |
513 // by the next sync from the main thread. | 514 // by the next sync from the main thread. |
514 scoped_ptr<LayerTreeImpl> recycle_tree_; | 515 scoped_ptr<LayerTreeImpl> recycle_tree_; |
515 | 516 |
516 InputHandlerClient* input_handler_client_; | 517 InputHandlerClient* input_handler_client_; |
517 bool did_lock_scrolling_layer_; | 518 bool did_lock_scrolling_layer_; |
518 bool should_bubble_scrolls_; | 519 bool should_bubble_scrolls_; |
519 bool wheel_scrolling_; | 520 bool wheel_scrolling_; |
520 | 521 |
521 bool manage_tiles_needed_; | 522 bool tile_priorities_dirty_; |
522 | 523 |
523 // The optional delegate for the root layer scroll offset. | 524 // The optional delegate for the root layer scroll offset. |
524 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 525 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
525 LayerTreeSettings settings_; | 526 LayerTreeSettings settings_; |
526 LayerTreeDebugState debug_state_; | 527 LayerTreeDebugState debug_state_; |
527 bool visible_; | 528 bool visible_; |
528 ManagedMemoryPolicy cached_managed_memory_policy_; | 529 ManagedMemoryPolicy cached_managed_memory_policy_; |
529 | 530 |
530 gfx::Vector2dF accumulated_root_overscroll_; | 531 gfx::Vector2dF accumulated_root_overscroll_; |
531 gfx::Vector2dF current_fling_velocity_; | 532 gfx::Vector2dF current_fling_velocity_; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 608 |
608 // Optional callback to notify of new tree activations. | 609 // Optional callback to notify of new tree activations. |
609 base::Closure tree_activation_callback_; | 610 base::Closure tree_activation_callback_; |
610 | 611 |
611 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 612 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
612 }; | 613 }; |
613 | 614 |
614 } // namespace cc | 615 } // namespace cc |
615 | 616 |
616 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 617 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |