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

Side by Side Diff: cc/layers/layer.h

Issue 13465014: LayerTreeHost::SetAnimationEvents should use AnimationRegistrar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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_LAYERS_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "cc/animation/layer_animation_controller.h" 13 #include "cc/animation/layer_animation_controller.h"
14 #include "cc/animation/layer_animation_event_observer.h"
15 #include "cc/animation/layer_animation_value_observer.h" 14 #include "cc/animation/layer_animation_value_observer.h"
16 #include "cc/base/cc_export.h" 15 #include "cc/base/cc_export.h"
17 #include "cc/base/region.h" 16 #include "cc/base/region.h"
18 #include "cc/layers/draw_properties.h" 17 #include "cc/layers/draw_properties.h"
19 #include "cc/layers/layer_lists.h" 18 #include "cc/layers/layer_lists.h"
20 #include "cc/layers/render_surface.h" 19 #include "cc/layers/render_surface.h"
21 #include "cc/trees/occlusion_tracker.h" 20 #include "cc/trees/occlusion_tracker.h"
22 #include "skia/ext/refptr.h" 21 #include "skia/ext/refptr.h"
23 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h" 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h"
24 #include "third_party/skia/include/core/SkColor.h" 23 #include "third_party/skia/include/core/SkColor.h"
25 #include "third_party/skia/include/core/SkImageFilter.h" 24 #include "third_party/skia/include/core/SkImageFilter.h"
26 #include "ui/gfx/rect.h" 25 #include "ui/gfx/rect.h"
27 #include "ui/gfx/rect_f.h" 26 #include "ui/gfx/rect_f.h"
28 #include "ui/gfx/transform.h" 27 #include "ui/gfx/transform.h"
29 28
30 namespace WebKit { 29 namespace WebKit {
31 class WebAnimationDelegate; 30 class WebAnimationDelegate;
32 class WebLayerScrollClient; 31 class WebLayerScrollClient;
33 } 32 }
34 33
35 namespace cc { 34 namespace cc {
36 35
37 class Animation; 36 class Animation;
38 struct AnimationEvent; 37 struct AnimationEvent;
39 class LayerAnimationDelegate; 38 class LayerAnimationDelegate;
39 class LayerAnimationEventObserver;
40 class LayerImpl; 40 class LayerImpl;
41 class LayerTreeHost; 41 class LayerTreeHost;
42 class LayerTreeImpl; 42 class LayerTreeImpl;
43 class PriorityCalculator; 43 class PriorityCalculator;
44 class RenderingStatsInstrumentation; 44 class RenderingStatsInstrumentation;
45 class ResourceUpdateQueue; 45 class ResourceUpdateQueue;
46 class ScrollbarLayer; 46 class ScrollbarLayer;
47 struct AnimationEvent; 47 struct AnimationEvent;
48 struct RenderingStats; 48 struct RenderingStats;
49 49
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } 318 LayerTreeHost* layer_tree_host() const { return layer_tree_host_; }
319 319
320 // Set the priority of all desired textures in this layer. 320 // Set the priority of all desired textures in this layer.
321 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) {} 321 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) {}
322 322
323 bool AddAnimation(scoped_ptr<Animation> animation); 323 bool AddAnimation(scoped_ptr<Animation> animation);
324 void PauseAnimation(int animation_id, double time_offset); 324 void PauseAnimation(int animation_id, double time_offset);
325 void RemoveAnimation(int animation_id); 325 void RemoveAnimation(int animation_id);
326 326
327 void TransferAnimationsTo(Layer* layer);
328
327 void SuspendAnimations(double monotonic_time); 329 void SuspendAnimations(double monotonic_time);
328 void ResumeAnimations(double monotonic_time); 330 void ResumeAnimations(double monotonic_time);
329 331
330 LayerAnimationController* layer_animation_controller() { 332 LayerAnimationController* layer_animation_controller() {
331 return layer_animation_controller_.get(); 333 return layer_animation_controller_.get();
332 } 334 }
333 void SetLayerAnimationController( 335 void SetLayerAnimationControllerForTest(
334 scoped_refptr<LayerAnimationController> controller); 336 scoped_refptr<LayerAnimationController> controller);
335 scoped_refptr<LayerAnimationController> ReleaseLayerAnimationController();
336 337
337 void set_layer_animation_delegate(WebKit::WebAnimationDelegate* delegate) { 338 void set_layer_animation_delegate(WebKit::WebAnimationDelegate* delegate) {
338 layer_animation_delegate_ = delegate; 339 layer_animation_controller_->set_layer_animation_delegate(delegate);
339 } 340 }
340 341
341 bool HasActiveAnimation() const; 342 bool HasActiveAnimation() const;
342 343
343 virtual void NotifyAnimationStarted(const AnimationEvent& event,
344 double wall_clock_time);
345 virtual void NotifyAnimationFinished(double wall_clock_time);
346 virtual void NotifyAnimationPropertyUpdate(const AnimationEvent& event);
347
348 void AddLayerAnimationEventObserver( 344 void AddLayerAnimationEventObserver(
349 LayerAnimationEventObserver* animation_observer); 345 LayerAnimationEventObserver* animation_observer);
350 void RemoveLayerAnimationEventObserver( 346 void RemoveLayerAnimationEventObserver(
351 LayerAnimationEventObserver* animation_observer); 347 LayerAnimationEventObserver* animation_observer);
352 348
353 virtual Region VisibleContentOpaqueRegion() const; 349 virtual Region VisibleContentOpaqueRegion() const;
354 350
355 virtual ScrollbarLayer* ToScrollbarLayer(); 351 virtual ScrollbarLayer* ToScrollbarLayer();
356 352
357 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; 353 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 virtual bool IsActive() const OVERRIDE; 420 virtual bool IsActive() const OVERRIDE;
425 421
426 LayerList children_; 422 LayerList children_;
427 Layer* parent_; 423 Layer* parent_;
428 424
429 // Layer instances have a weak pointer to their LayerTreeHost. 425 // Layer instances have a weak pointer to their LayerTreeHost.
430 // This pointer value is nil when a Layer is not in a tree and is 426 // This pointer value is nil when a Layer is not in a tree and is
431 // updated via SetLayerTreeHost() if a layer moves between trees. 427 // updated via SetLayerTreeHost() if a layer moves between trees.
432 LayerTreeHost* layer_tree_host_; 428 LayerTreeHost* layer_tree_host_;
433 429
434 ObserverList<LayerAnimationEventObserver> layer_animation_observers_;
435
436 scoped_refptr<LayerAnimationController> layer_animation_controller_; 430 scoped_refptr<LayerAnimationController> layer_animation_controller_;
437 431
438 // Layer properties. 432 // Layer properties.
439 gfx::Size bounds_; 433 gfx::Size bounds_;
440 434
441 gfx::Vector2d scroll_offset_; 435 gfx::Vector2d scroll_offset_;
442 gfx::Vector2d max_scroll_offset_; 436 gfx::Vector2d max_scroll_offset_;
443 bool scrollable_; 437 bool scrollable_;
444 bool should_scroll_on_main_thread_; 438 bool should_scroll_on_main_thread_;
445 bool have_wheel_event_handlers_; 439 bool have_wheel_event_handlers_;
(...skipping 25 matching lines...) Expand all
471 // Replica layer used for reflections. 465 // Replica layer used for reflections.
472 scoped_refptr<Layer> replica_layer_; 466 scoped_refptr<Layer> replica_layer_;
473 467
474 // Transient properties. 468 // Transient properties.
475 float raster_scale_; 469 float raster_scale_;
476 bool automatically_compute_raster_scale_; 470 bool automatically_compute_raster_scale_;
477 bool bounds_contain_page_scale_; 471 bool bounds_contain_page_scale_;
478 472
479 gfx::Transform impl_transform_; 473 gfx::Transform impl_transform_;
480 474
481 WebKit::WebAnimationDelegate* layer_animation_delegate_;
482 WebKit::WebLayerScrollClient* layer_scroll_client_; 475 WebKit::WebLayerScrollClient* layer_scroll_client_;
483 476
484 DrawProperties<Layer, RenderSurface> draw_properties_; 477 DrawProperties<Layer, RenderSurface> draw_properties_;
485 478
486 DISALLOW_COPY_AND_ASSIGN(Layer); 479 DISALLOW_COPY_AND_ASSIGN(Layer);
487 }; 480 };
488 481
489 } // namespace cc 482 } // namespace cc
490 483
491 #endif // CC_LAYERS_LAYER_H_ 484 #endif // CC_LAYERS_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698