| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class CompletionEvent; | 28 class CompletionEvent; |
| 29 class CompositorFrameMetadata; | 29 class CompositorFrameMetadata; |
| 30 class DebugRectHistory; | 30 class DebugRectHistory; |
| 31 class FrameRateCounter; | 31 class FrameRateCounter; |
| 32 class LayerImpl; | 32 class LayerImpl; |
| 33 class LayerTreeHostImplTimeSourceAdapter; | 33 class LayerTreeHostImplTimeSourceAdapter; |
| 34 class LayerTreeImpl; | 34 class LayerTreeImpl; |
| 35 class PageScaleAnimation; | 35 class PageScaleAnimation; |
| 36 class PaintTimeCounter; | 36 class PaintTimeCounter; |
| 37 class MemoryHistory; | 37 class MemoryHistory; |
| 38 class RenderingStatsInstrumentation; |
| 38 class RenderPassDrawQuad; | 39 class RenderPassDrawQuad; |
| 39 class ResourceProvider; | 40 class ResourceProvider; |
| 40 class TopControlsManager; | 41 class TopControlsManager; |
| 41 struct RendererCapabilities; | 42 struct RendererCapabilities; |
| 42 struct RenderingStats; | |
| 43 | 43 |
| 44 // LayerTreeHost->Proxy callback interface. | 44 // LayerTreeHost->Proxy callback interface. |
| 45 class LayerTreeHostImplClient { | 45 class LayerTreeHostImplClient { |
| 46 public: | 46 public: |
| 47 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 47 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
| 48 virtual void OnSwapBuffersCompleteOnImplThread() = 0; | 48 virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
| 49 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 49 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
| 50 base::TimeDelta interval) = 0; | 50 base::TimeDelta interval) = 0; |
| 51 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 51 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
| 52 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; | 52 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 74 public RendererClient, | 74 public RendererClient, |
| 75 public TileManagerClient, | 75 public TileManagerClient, |
| 76 public OutputSurfaceClient, | 76 public OutputSurfaceClient, |
| 77 public TopControlsManagerClient { | 77 public TopControlsManagerClient { |
| 78 public: | 78 public: |
| 79 typedef std::vector<LayerImpl*> LayerList; | 79 typedef std::vector<LayerImpl*> LayerList; |
| 80 | 80 |
| 81 static scoped_ptr<LayerTreeHostImpl> Create( | 81 static scoped_ptr<LayerTreeHostImpl> Create( |
| 82 const LayerTreeSettings& settings, | 82 const LayerTreeSettings& settings, |
| 83 LayerTreeHostImplClient* client, | 83 LayerTreeHostImplClient* client, |
| 84 Proxy* proxy); | 84 Proxy* proxy, |
| 85 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 85 virtual ~LayerTreeHostImpl(); | 86 virtual ~LayerTreeHostImpl(); |
| 86 | 87 |
| 87 // InputHandlerClient implementation | 88 // InputHandlerClient implementation |
| 88 virtual InputHandlerClient::ScrollStatus ScrollBegin( | 89 virtual InputHandlerClient::ScrollStatus ScrollBegin( |
| 89 gfx::Point viewport_point, | 90 gfx::Point viewport_point, |
| 90 InputHandlerClient::ScrollInputType type) OVERRIDE; | 91 InputHandlerClient::ScrollInputType type) OVERRIDE; |
| 91 virtual bool ScrollBy(gfx::Point viewport_point, | 92 virtual bool ScrollBy(gfx::Point viewport_point, |
| 92 gfx::Vector2dF scroll_delta) OVERRIDE; | 93 gfx::Vector2dF scroll_delta) OVERRIDE; |
| 93 virtual void ScrollEnd() OVERRIDE; | 94 virtual void ScrollEnd() OVERRIDE; |
| 94 virtual void PinchGestureBegin() OVERRIDE; | 95 virtual void PinchGestureBegin() OVERRIDE; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 232 |
| 232 void StartPageScaleAnimation(gfx::Vector2d target_offset, | 233 void StartPageScaleAnimation(gfx::Vector2d target_offset, |
| 233 bool use_anchor, | 234 bool use_anchor, |
| 234 float scale, | 235 float scale, |
| 235 base::TimeDelta duration); | 236 base::TimeDelta duration); |
| 236 | 237 |
| 237 bool needs_animate_layers() const { | 238 bool needs_animate_layers() const { |
| 238 return !animation_registrar_->active_animation_controllers().empty(); | 239 return !animation_registrar_->active_animation_controllers().empty(); |
| 239 } | 240 } |
| 240 | 241 |
| 241 void CollectRenderingStats(RenderingStats* stats) const; | |
| 242 | |
| 243 void SendManagedMemoryStats( | 242 void SendManagedMemoryStats( |
| 244 size_t memory_visible_bytes, | 243 size_t memory_visible_bytes, |
| 245 size_t memory_visible_and_nearby_bytes, | 244 size_t memory_visible_and_nearby_bytes, |
| 246 size_t memoryUseBytes); | 245 size_t memoryUseBytes); |
| 247 | 246 |
| 248 FrameRateCounter* fps_counter() { | 247 FrameRateCounter* fps_counter() { |
| 249 return fps_counter_.get(); | 248 return fps_counter_.get(); |
| 250 } | 249 } |
| 251 PaintTimeCounter* paint_time_counter() { | 250 PaintTimeCounter* paint_time_counter() { |
| 252 return paint_time_counter_.get(); | 251 return paint_time_counter_.get(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 void BeginNextFrame(); | 321 void BeginNextFrame(); |
| 323 base::TimeTicks CurrentFrameTime(); | 322 base::TimeTicks CurrentFrameTime(); |
| 324 | 323 |
| 325 scoped_ptr<base::Value> AsValue() const; | 324 scoped_ptr<base::Value> AsValue() const; |
| 326 scoped_ptr<base::Value> ActivationStateAsValue() const; | 325 scoped_ptr<base::Value> ActivationStateAsValue() const; |
| 327 scoped_ptr<base::Value> FrameStateAsValue() const; | 326 scoped_ptr<base::Value> FrameStateAsValue() const; |
| 328 | 327 |
| 329 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 328 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
| 330 | 329 |
| 331 protected: | 330 protected: |
| 332 LayerTreeHostImpl(const LayerTreeSettings& settings, | 331 LayerTreeHostImpl( |
| 333 LayerTreeHostImplClient* client, | 332 const LayerTreeSettings& settings, |
| 334 Proxy* proxy); | 333 LayerTreeHostImplClient* client, |
| 334 Proxy* proxy, |
| 335 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 335 void ActivatePendingTree(); | 336 void ActivatePendingTree(); |
| 336 | 337 |
| 337 // Virtual for testing. | 338 // Virtual for testing. |
| 338 virtual void AnimateLayers(base::TimeTicks monotonic_time, | 339 virtual void AnimateLayers(base::TimeTicks monotonic_time, |
| 339 base::Time wall_clock_time); | 340 base::Time wall_clock_time); |
| 340 virtual void UpdateAnimationState(); | 341 virtual void UpdateAnimationState(); |
| 341 | 342 |
| 342 // Virtual for testing. | 343 // Virtual for testing. |
| 343 virtual base::TimeDelta LowFrequencyAnimationInterval() const; | 344 virtual base::TimeDelta LowFrequencyAnimationInterval() const; |
| 344 | 345 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 int64 cumulative_num_missing_tiles_; | 442 int64 cumulative_num_missing_tiles_; |
| 442 | 443 |
| 443 size_t last_sent_memory_visible_bytes_; | 444 size_t last_sent_memory_visible_bytes_; |
| 444 size_t last_sent_memory_visible_and_nearby_bytes_; | 445 size_t last_sent_memory_visible_and_nearby_bytes_; |
| 445 size_t last_sent_memory_use_bytes_; | 446 size_t last_sent_memory_use_bytes_; |
| 446 | 447 |
| 447 base::TimeTicks current_frame_time_; | 448 base::TimeTicks current_frame_time_; |
| 448 | 449 |
| 449 scoped_ptr<AnimationRegistrar> animation_registrar_; | 450 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 450 | 451 |
| 452 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 453 |
| 451 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 454 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 452 }; | 455 }; |
| 453 | 456 |
| 454 } // namespace cc | 457 } // namespace cc |
| 455 | 458 |
| 456 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 459 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |