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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 bool zero_budget); | 454 bool zero_budget); |
454 void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy); | 455 void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy); |
455 | 456 |
456 void DidInitializeVisibleTile(); | 457 void DidInitializeVisibleTile(); |
457 | 458 |
458 typedef base::hash_map<UIResourceId, ResourceProvider::ResourceId> | 459 typedef base::hash_map<UIResourceId, ResourceProvider::ResourceId> |
459 UIResourceMap; | 460 UIResourceMap; |
460 UIResourceMap ui_resource_map_; | 461 UIResourceMap ui_resource_map_; |
461 | 462 |
462 scoped_ptr<OutputSurface> output_surface_; | 463 scoped_ptr<OutputSurface> output_surface_; |
| 464 bool output_surface_lost_; |
463 | 465 |
464 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- | 466 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
465 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). | 467 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
466 scoped_ptr<ResourceProvider> resource_provider_; | 468 scoped_ptr<ResourceProvider> resource_provider_; |
467 scoped_ptr<TileManager> tile_manager_; | 469 scoped_ptr<TileManager> tile_manager_; |
468 scoped_ptr<Renderer> renderer_; | 470 scoped_ptr<Renderer> renderer_; |
469 | 471 |
470 // Tree currently being drawn. | 472 // Tree currently being drawn. |
471 scoped_ptr<LayerTreeImpl> active_tree_; | 473 scoped_ptr<LayerTreeImpl> active_tree_; |
472 | 474 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 | 559 |
558 // Optional callback to notify of new tree activations. | 560 // Optional callback to notify of new tree activations. |
559 base::Closure tree_activation_callback_; | 561 base::Closure tree_activation_callback_; |
560 | 562 |
561 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 563 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
562 }; | 564 }; |
563 | 565 |
564 } // namespace cc | 566 } // namespace cc |
565 | 567 |
566 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 568 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |