| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // LayerTreeHost->Proxy callback interface. | 54 // LayerTreeHost->Proxy callback interface. |
| 55 class LayerTreeHostImplClient { | 55 class LayerTreeHostImplClient { |
| 56 public: | 56 public: |
| 57 virtual void DidTryInitializeRendererOnImplThread( | 57 virtual void DidTryInitializeRendererOnImplThread( |
| 58 bool success, | 58 bool success, |
| 59 scoped_refptr<ContextProvider> offscreen_context_provider) = 0; | 59 scoped_refptr<ContextProvider> offscreen_context_provider) = 0; |
| 60 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 60 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
| 61 virtual void OnSwapBuffersCompleteOnImplThread() = 0; | 61 virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
| 62 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0; | 62 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0; |
| 63 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 63 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
| 64 virtual void NotifyReadyToActivate() = 0; |
| 64 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; | 65 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; |
| 65 virtual void SetNeedsRedrawOnImplThread() = 0; | 66 virtual void SetNeedsRedrawOnImplThread() = 0; |
| 66 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; | 67 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; |
| 67 virtual void DidInitializeVisibleTileOnImplThread() = 0; | 68 virtual void DidInitializeVisibleTileOnImplThread() = 0; |
| 68 virtual void SetNeedsCommitOnImplThread() = 0; | 69 virtual void SetNeedsCommitOnImplThread() = 0; |
| 69 virtual void PostAnimationEventsToMainThreadOnImplThread( | 70 virtual void PostAnimationEventsToMainThreadOnImplThread( |
| 70 scoped_ptr<AnimationEventsVector> events, | 71 scoped_ptr<AnimationEventsVector> events, |
| 71 base::Time wall_clock_time) = 0; | 72 base::Time wall_clock_time) = 0; |
| 72 // Returns true if resources were deleted by this call. | 73 // Returns true if resources were deleted by this call. |
| 73 virtual bool ReduceContentsTextureMemoryOnImplThread( | 74 virtual bool ReduceContentsTextureMemoryOnImplThread( |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); | 242 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); |
| 242 | 243 |
| 243 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 244 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
| 244 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 245 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
| 245 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 246 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
| 246 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 247 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
| 247 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 248 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
| 248 virtual void CreatePendingTree(); | 249 virtual void CreatePendingTree(); |
| 249 void UpdateVisibleTiles(); | 250 void UpdateVisibleTiles(); |
| 250 virtual void ActivatePendingTreeIfNeeded(); | 251 virtual void ActivatePendingTreeIfNeeded(); |
| 252 virtual void ActivatePendingTree(); |
| 251 | 253 |
| 252 // Shortcuts to layers on the active tree. | 254 // Shortcuts to layers on the active tree. |
| 253 LayerImpl* RootLayer() const; | 255 LayerImpl* RootLayer() const; |
| 254 LayerImpl* RootScrollLayer() const; | 256 LayerImpl* RootScrollLayer() const; |
| 255 LayerImpl* CurrentlyScrollingLayer() const; | 257 LayerImpl* CurrentlyScrollingLayer() const; |
| 256 | 258 |
| 257 virtual void SetVisible(bool visible); | 259 virtual void SetVisible(bool visible); |
| 258 bool visible() const { return visible_; } | 260 bool visible() const { return visible_; } |
| 259 | 261 |
| 260 void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } | 262 void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 void DeleteUIResource(UIResourceId uid); | 386 void DeleteUIResource(UIResourceId uid); |
| 385 | 387 |
| 386 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 388 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 387 | 389 |
| 388 protected: | 390 protected: |
| 389 LayerTreeHostImpl( | 391 LayerTreeHostImpl( |
| 390 const LayerTreeSettings& settings, | 392 const LayerTreeSettings& settings, |
| 391 LayerTreeHostImplClient* client, | 393 LayerTreeHostImplClient* client, |
| 392 Proxy* proxy, | 394 Proxy* proxy, |
| 393 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 395 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 394 virtual void ActivatePendingTree(); | |
| 395 | 396 |
| 396 // Virtual for testing. | 397 // Virtual for testing. |
| 397 virtual void AnimateLayers(base::TimeTicks monotonic_time, | 398 virtual void AnimateLayers(base::TimeTicks monotonic_time, |
| 398 base::Time wall_clock_time); | 399 base::Time wall_clock_time); |
| 399 | 400 |
| 400 // Virtual for testing. | 401 // Virtual for testing. |
| 401 virtual base::TimeDelta LowFrequencyAnimationInterval() const; | 402 virtual base::TimeDelta LowFrequencyAnimationInterval() const; |
| 402 | 403 |
| 403 const AnimationRegistrar::AnimationControllerMap& | 404 const AnimationRegistrar::AnimationControllerMap& |
| 404 active_animation_controllers() const { | 405 active_animation_controllers() const { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 | 558 |
| 558 // Optional callback to notify of new tree activations. | 559 // Optional callback to notify of new tree activations. |
| 559 base::Closure tree_activation_callback_; | 560 base::Closure tree_activation_callback_; |
| 560 | 561 |
| 561 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 562 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 562 }; | 563 }; |
| 563 | 564 |
| 564 } // namespace cc | 565 } // namespace cc |
| 565 | 566 |
| 566 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 567 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |