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_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 scoped_ptr<AnimationEventsVector> events, | 58 scoped_ptr<AnimationEventsVector> events, |
59 base::Time wall_clock_time) = 0; | 59 base::Time wall_clock_time) = 0; |
60 // Returns true if resources were deleted by this call. | 60 // Returns true if resources were deleted by this call. |
61 virtual bool ReduceContentsTextureMemoryOnImplThread( | 61 virtual bool ReduceContentsTextureMemoryOnImplThread( |
62 size_t limit_bytes, | 62 size_t limit_bytes, |
63 int priority_cutoff) = 0; | 63 int priority_cutoff) = 0; |
64 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; | 64 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; |
65 virtual void SendManagedMemoryStats() = 0; | 65 virtual void SendManagedMemoryStats() = 0; |
66 virtual bool IsInsideDraw() = 0; | 66 virtual bool IsInsideDraw() = 0; |
67 virtual void RenewTreePriority() = 0; | 67 virtual void RenewTreePriority() = 0; |
68 virtual void RequestScrollbarAnimationOnImplThread(double delay) = 0; | |
jamesr
2013/03/14 19:52:01
let's use base::TimeDeltas for delays. With this
| |
68 }; | 69 }; |
69 | 70 |
70 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 71 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
71 // state. | 72 // state. |
72 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, | 73 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, |
73 public RendererClient, | 74 public RendererClient, |
74 public TileManagerClient, | 75 public TileManagerClient, |
75 public OutputSurfaceClient, | 76 public OutputSurfaceClient, |
76 public TopControlsManagerClient { | 77 public TopControlsManagerClient { |
77 typedef std::vector<LayerImpl*> LayerList; | 78 typedef std::vector<LayerImpl*> LayerList; |
(...skipping 23 matching lines...) Expand all Loading... | |
101 base::TimeDelta duration) OVERRIDE; | 102 base::TimeDelta duration) OVERRIDE; |
102 virtual void ScheduleAnimation() OVERRIDE; | 103 virtual void ScheduleAnimation() OVERRIDE; |
103 virtual bool HaveTouchEventHandlersAt(gfx::Point viewport_port) OVERRIDE; | 104 virtual bool HaveTouchEventHandlersAt(gfx::Point viewport_port) OVERRIDE; |
104 | 105 |
105 // TopControlsManagerClient implementation. | 106 // TopControlsManagerClient implementation. |
106 virtual void setActiveTreeNeedsUpdateDrawProperties() OVERRIDE; | 107 virtual void setActiveTreeNeedsUpdateDrawProperties() OVERRIDE; |
107 virtual void setNeedsRedraw() OVERRIDE; | 108 virtual void setNeedsRedraw() OVERRIDE; |
108 virtual bool haveRootScrollLayer() const OVERRIDE; | 109 virtual bool haveRootScrollLayer() const OVERRIDE; |
109 virtual float rootScrollLayerTotalScrollY() const OVERRIDE; | 110 virtual float rootScrollLayerTotalScrollY() const OVERRIDE; |
110 | 111 |
112 void StartScrollbarAnimation(base::TimeTicks now); | |
113 | |
111 struct CC_EXPORT FrameData : public RenderPassSink { | 114 struct CC_EXPORT FrameData : public RenderPassSink { |
112 FrameData(); | 115 FrameData(); |
113 ~FrameData(); | 116 ~FrameData(); |
114 | 117 |
115 std::vector<gfx::Rect> occluding_screen_space_rects; | 118 std::vector<gfx::Rect> occluding_screen_space_rects; |
116 std::vector<gfx::Rect> non_occluding_screen_space_rects; | 119 std::vector<gfx::Rect> non_occluding_screen_space_rects; |
117 RenderPassList render_passes; | 120 RenderPassList render_passes; |
118 RenderPassIdHashMap render_passes_by_id; | 121 RenderPassIdHashMap render_passes_by_id; |
119 const LayerList* render_surface_layer_list; | 122 const LayerList* render_surface_layer_list; |
120 LayerList will_draw_layers; | 123 LayerList will_draw_layers; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 | 373 |
371 void AnimateScrollbarsRecursive(LayerImpl* layer, | 374 void AnimateScrollbarsRecursive(LayerImpl* layer, |
372 base::TimeTicks time); | 375 base::TimeTicks time); |
373 | 376 |
374 void DumpRenderSurfaces(std::string* str, | 377 void DumpRenderSurfaces(std::string* str, |
375 int indent, | 378 int indent, |
376 const LayerImpl* layer) const; | 379 const LayerImpl* layer) const; |
377 | 380 |
378 static LayerImpl* GetNonCompositedContentLayerRecursive(LayerImpl* layer); | 381 static LayerImpl* GetNonCompositedContentLayerRecursive(LayerImpl* layer); |
379 | 382 |
383 void StartScrollbarAnimationRecursive(LayerImpl* layer, base::TimeTicks time); | |
384 | |
380 scoped_ptr<OutputSurface> output_surface_; | 385 scoped_ptr<OutputSurface> output_surface_; |
381 scoped_ptr<ResourceProvider> resource_provider_; | 386 scoped_ptr<ResourceProvider> resource_provider_; |
382 scoped_ptr<Renderer> renderer_; | 387 scoped_ptr<Renderer> renderer_; |
383 scoped_ptr<TileManager> tile_manager_; | 388 scoped_ptr<TileManager> tile_manager_; |
384 | 389 |
385 // Tree currently being drawn. | 390 // Tree currently being drawn. |
386 scoped_ptr<LayerTreeImpl> active_tree_; | 391 scoped_ptr<LayerTreeImpl> active_tree_; |
387 | 392 |
388 // In impl-side painting mode, tree with possibly incomplete rasterized | 393 // In impl-side painting mode, tree with possibly incomplete rasterized |
389 // content. May be promoted to active by ActivatePendingTreeIfNeeded(). | 394 // content. May be promoted to active by ActivatePendingTreeIfNeeded(). |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
437 base::TimeTicks current_frame_time_; | 442 base::TimeTicks current_frame_time_; |
438 | 443 |
439 scoped_ptr<AnimationRegistrar> animation_registrar_; | 444 scoped_ptr<AnimationRegistrar> animation_registrar_; |
440 | 445 |
441 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 446 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
442 }; | 447 }; |
443 | 448 |
444 } // namespace cc | 449 } // namespace cc |
445 | 450 |
446 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 451 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |