Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 947033002: CC Animations: Establish AnimationHost, AnimationTimeline and AnimationPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix MSVC warning. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 20 matching lines...) Expand all
31 #include "cc/output/renderer.h" 31 #include "cc/output/renderer.h"
32 #include "cc/quads/render_pass.h" 32 #include "cc/quads/render_pass.h"
33 #include "cc/resources/resource_provider.h" 33 #include "cc/resources/resource_provider.h"
34 #include "cc/resources/ui_resource_client.h" 34 #include "cc/resources/ui_resource_client.h"
35 #include "cc/scheduler/begin_frame_tracker.h" 35 #include "cc/scheduler/begin_frame_tracker.h"
36 #include "cc/scheduler/commit_earlyout_reason.h" 36 #include "cc/scheduler/commit_earlyout_reason.h"
37 #include "cc/scheduler/draw_result.h" 37 #include "cc/scheduler/draw_result.h"
38 #include "cc/scheduler/video_frame_controller.h" 38 #include "cc/scheduler/video_frame_controller.h"
39 #include "cc/tiles/tile_manager.h" 39 #include "cc/tiles/tile_manager.h"
40 #include "cc/trees/layer_tree_settings.h" 40 #include "cc/trees/layer_tree_settings.h"
41 #include "cc/trees/mutator_host_client.h"
41 #include "cc/trees/proxy.h" 42 #include "cc/trees/proxy.h"
42 #include "skia/ext/refptr.h" 43 #include "skia/ext/refptr.h"
43 #include "third_party/skia/include/core/SkColor.h" 44 #include "third_party/skia/include/core/SkColor.h"
44 #include "ui/gfx/geometry/rect.h" 45 #include "ui/gfx/geometry/rect.h"
45 46
46 namespace gfx { 47 namespace gfx {
47 class ScrollOffset; 48 class ScrollOffset;
48 } 49 }
49 50
50 namespace cc { 51 namespace cc {
51 52
53 class AnimationHost;
52 class CompletionEvent; 54 class CompletionEvent;
53 class CompositorFrameMetadata; 55 class CompositorFrameMetadata;
54 class DebugRectHistory; 56 class DebugRectHistory;
55 class EvictionTilePriorityQueue; 57 class EvictionTilePriorityQueue;
56 class FrameRateCounter; 58 class FrameRateCounter;
57 class LayerImpl; 59 class LayerImpl;
58 class LayerTreeImpl; 60 class LayerTreeImpl;
59 class MemoryHistory; 61 class MemoryHistory;
60 class PageScaleAnimation; 62 class PageScaleAnimation;
61 class PaintTimeCounter; 63 class PaintTimeCounter;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering 136 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering
135 // state. 137 // state.
136 class CC_EXPORT LayerTreeHostImpl 138 class CC_EXPORT LayerTreeHostImpl
137 : public InputHandler, 139 : public InputHandler,
138 public RendererClient, 140 public RendererClient,
139 public TileManagerClient, 141 public TileManagerClient,
140 public OutputSurfaceClient, 142 public OutputSurfaceClient,
141 public TopControlsManagerClient, 143 public TopControlsManagerClient,
142 public ScrollbarAnimationControllerClient, 144 public ScrollbarAnimationControllerClient,
143 public VideoFrameControllerClient, 145 public VideoFrameControllerClient,
146 public MutatorHostClient,
144 public base::SupportsWeakPtr<LayerTreeHostImpl> { 147 public base::SupportsWeakPtr<LayerTreeHostImpl> {
145 public: 148 public:
146 static scoped_ptr<LayerTreeHostImpl> Create( 149 static scoped_ptr<LayerTreeHostImpl> Create(
147 const LayerTreeSettings& settings, 150 const LayerTreeSettings& settings,
148 LayerTreeHostImplClient* client, 151 LayerTreeHostImplClient* client,
149 Proxy* proxy, 152 Proxy* proxy,
150 RenderingStatsInstrumentation* rendering_stats_instrumentation, 153 RenderingStatsInstrumentation* rendering_stats_instrumentation,
151 SharedBitmapManager* shared_bitmap_manager, 154 SharedBitmapManager* shared_bitmap_manager,
152 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 155 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
153 TaskGraphRunner* task_graph_runner, 156 TaskGraphRunner* task_graph_runner,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); 225 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason);
223 virtual void BeginCommit(); 226 virtual void BeginCommit();
224 virtual void CommitComplete(); 227 virtual void CommitComplete();
225 virtual void Animate(base::TimeTicks monotonic_time); 228 virtual void Animate(base::TimeTicks monotonic_time);
226 virtual void UpdateAnimationState(bool start_ready_animations); 229 virtual void UpdateAnimationState(bool start_ready_animations);
227 void ActivateAnimations(); 230 void ActivateAnimations();
228 void MainThreadHasStoppedFlinging(); 231 void MainThreadHasStoppedFlinging();
229 void DidAnimateScrollOffset(); 232 void DidAnimateScrollOffset();
230 void SetViewportDamage(const gfx::Rect& damage_rect); 233 void SetViewportDamage(const gfx::Rect& damage_rect);
231 234
235 void SetTreeLayerFilterMutated(int layer_id,
236 LayerTreeImpl* tree,
237 const FilterOperations& filters);
238 void SetTreeLayerOpacityMutated(int layer_id,
239 LayerTreeImpl* tree,
240 float opacity);
241 void SetTreeLayerTransformMutated(int layer_id,
242 LayerTreeImpl* tree,
243 const gfx::Transform& transform);
244 void SetTreeLayerScrollOffsetMutated(int layer_id,
245 LayerTreeImpl* tree,
246 const gfx::ScrollOffset& scroll_offset);
247
248 // LayerTreeMutatorsClient implementation.
249 bool IsLayerInTree(int layer_id, LayerTreeType tree_type) const override;
250 void SetMutatorsNeedCommit() override;
251 void SetLayerFilterMutated(int layer_id,
252 LayerTreeType tree_type,
253 const FilterOperations& filters) override;
254 void SetLayerOpacityMutated(int layer_id,
255 LayerTreeType tree_type,
256 float opacity) override;
257 void SetLayerTransformMutated(int layer_id,
258 LayerTreeType tree_type,
259 const gfx::Transform& transform) override;
260 void SetLayerScrollOffsetMutated(
261 int layer_id,
262 LayerTreeType tree_type,
263 const gfx::ScrollOffset& scroll_offset) override;
264
232 virtual void PrepareTiles(); 265 virtual void PrepareTiles();
233 266
234 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we 267 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we
235 // should try to avoid displaying the frame. If PrepareToDraw is called, 268 // should try to avoid displaying the frame. If PrepareToDraw is called,
236 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is 269 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is
237 // called between the two. 270 // called between the two.
238 virtual DrawResult PrepareToDraw(FrameData* frame); 271 virtual DrawResult PrepareToDraw(FrameData* frame);
239 virtual void DrawLayers(FrameData* frame); 272 virtual void DrawLayers(FrameData* frame);
240 // Must be called if and only if PrepareToDraw was called. 273 // Must be called if and only if PrepareToDraw was called.
241 void DidDrawAllLayers(const FrameData& frame); 274 void DidDrawAllLayers(const FrameData& frame);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 469 }
437 const GlobalStateThatImpactsTilePriority& global_tile_state() { 470 const GlobalStateThatImpactsTilePriority& global_tile_state() {
438 return global_tile_state_; 471 return global_tile_state_;
439 } 472 }
440 473
441 Proxy* proxy() const { return proxy_; } 474 Proxy* proxy() const { return proxy_; }
442 475
443 AnimationRegistrar* animation_registrar() const { 476 AnimationRegistrar* animation_registrar() const {
444 return animation_registrar_.get(); 477 return animation_registrar_.get();
445 } 478 }
479 AnimationHost* animation_host() const { return animation_host_.get(); }
446 480
447 void SetDebugState(const LayerTreeDebugState& new_debug_state); 481 void SetDebugState(const LayerTreeDebugState& new_debug_state);
448 const LayerTreeDebugState& debug_state() const { return debug_state_; } 482 const LayerTreeDebugState& debug_state() const { return debug_state_; }
449 483
450 gfx::Vector2dF accumulated_root_overscroll() const { 484 gfx::Vector2dF accumulated_root_overscroll() const {
451 return accumulated_root_overscroll_; 485 return accumulated_root_overscroll_;
452 } 486 }
453 487
454 bool pinch_gesture_active() const { return pinch_gesture_active_; } 488 bool pinch_gesture_active() const { return pinch_gesture_active_; }
455 489
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 // tiling priority. 784 // tiling priority.
751 gfx::Transform external_transform_; 785 gfx::Transform external_transform_;
752 gfx::Rect external_viewport_; 786 gfx::Rect external_viewport_;
753 gfx::Rect external_clip_; 787 gfx::Rect external_clip_;
754 gfx::Rect viewport_rect_for_tile_priority_; 788 gfx::Rect viewport_rect_for_tile_priority_;
755 bool resourceless_software_draw_; 789 bool resourceless_software_draw_;
756 790
757 gfx::Rect viewport_damage_rect_; 791 gfx::Rect viewport_damage_rect_;
758 792
759 scoped_ptr<AnimationRegistrar> animation_registrar_; 793 scoped_ptr<AnimationRegistrar> animation_registrar_;
794 scoped_ptr<AnimationHost> animation_host_;
760 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; 795 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_;
761 std::set<VideoFrameController*> video_frame_controllers_; 796 std::set<VideoFrameController*> video_frame_controllers_;
762 797
763 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 798 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
764 MicroBenchmarkControllerImpl micro_benchmark_controller_; 799 MicroBenchmarkControllerImpl micro_benchmark_controller_;
765 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; 800 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_;
766 801
767 // Optional callback to notify of new tree activations. 802 // Optional callback to notify of new tree activations.
768 base::Closure tree_activation_callback_; 803 base::Closure tree_activation_callback_;
769 804
(...skipping 10 matching lines...) Expand all
780 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; 815 scoped_ptr<FrameTimingTracker> frame_timing_tracker_;
781 816
782 scoped_ptr<Viewport> viewport_; 817 scoped_ptr<Viewport> viewport_;
783 818
784 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 819 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
785 }; 820 };
786 821
787 } // namespace cc 822 } // namespace cc
788 823
789 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 824 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698