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

Side by Side Diff: Source/core/animation/Animation.h

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup isRunning* and shouldCompositeForAnimation Created 7 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class Element; 40 class Element;
41 41
42 class Animation FINAL : public TimedItem { 42 class Animation FINAL : public TimedItem {
43 43
44 public: 44 public:
45 enum Priority { DefaultPriority, TransitionPriority }; 45 enum Priority { DefaultPriority, TransitionPriority };
46 46
47 static PassRefPtr<Animation> create(PassRefPtr<Element>, PassRefPtr<Animatio nEffect>, const Timing&, Priority = DefaultPriority, PassOwnPtr<EventDelegate> = nullptr); 47 static PassRefPtr<Animation> create(PassRefPtr<Element>, PassRefPtr<Animatio nEffect>, const Timing&, Priority = DefaultPriority, PassOwnPtr<EventDelegate> = nullptr);
48 virtual bool isAnimation() OVERRIDE FINAL { return true; }
48 49
49 const AnimationEffect::CompositableValueMap* compositableValues() const 50 const AnimationEffect::CompositableValueMap* compositableValues() const
50 { 51 {
51 ASSERT(m_compositableValues); 52 ASSERT(m_compositableValues);
52 return m_compositableValues.get(); 53 return m_compositableValues.get();
53 } 54 }
54 55
56 bool affects(CSSPropertyID property) const;
55 const AnimationEffect* effect() const { return m_effect.get(); } 57 const AnimationEffect* effect() const { return m_effect.get(); }
56 Priority priority() const { return m_priority; } 58 Priority priority() const { return m_priority; }
57 59
60 bool isCandidateForCompositorAnimation() const;
61 bool startCompositorAnimations();
62 bool isRunningCompositorAnimation() const;
63 bool isRunningCompositorAnimation(CSSPropertyID) const;
64 void cancelCompositorAnimations();
Steve Block 2013/11/18 05:03:03 The use of 'Animation' here seems awkward given th
dstockwell 2013/11/18 06:11:20 I've made everything plural for now.
65
58 protected: 66 protected:
59 // Returns whether style recalc was triggered. 67 // Returns whether style recalc was triggered.
60 virtual bool applyEffects(bool previouslyInEffect); 68 virtual bool applyEffects(bool previouslyInEffect);
61 virtual void clearEffects(); 69 virtual void clearEffects();
62 virtual bool updateChildrenAndEffects() const OVERRIDE FINAL; 70 virtual bool updateChildrenAndEffects() const OVERRIDE FINAL;
63 virtual void didAttach() OVERRIDE FINAL; 71 virtual void didAttach() OVERRIDE FINAL;
64 virtual void willDetach() OVERRIDE FINAL; 72 virtual void willDetach() OVERRIDE FINAL;
65 virtual double calculateTimeToEffectChange(double inheritedTime, double time ToNextIteration) const OVERRIDE FINAL; 73 virtual double calculateTimeToEffectChange(double inheritedTime, double time ToNextIteration) const OVERRIDE FINAL;
66 74
67 private: 75 private:
68 Animation(PassRefPtr<Element>, PassRefPtr<AnimationEffect>, const Timing&, P riority, PassOwnPtr<EventDelegate>); 76 Animation(PassRefPtr<Element>, PassRefPtr<AnimationEffect>, const Timing&, P riority, PassOwnPtr<EventDelegate>);
69 77
70 RefPtr<Element> m_target; 78 RefPtr<Element> m_target;
71 RefPtr<AnimationEffect> m_effect; 79 RefPtr<AnimationEffect> m_effect;
72 80
73 bool m_activeInAnimationStack; 81 bool m_activeInAnimationStack;
74 OwnPtr<AnimationEffect::CompositableValueMap> m_compositableValues; 82 OwnPtr<AnimationEffect::CompositableValueMap> m_compositableValues;
75 83
76 Priority m_priority; 84 Priority m_priority;
85
86 Vector<int> m_acceleratedAnimationIds;
Steve Block 2013/11/18 05:03:03 We should be consistent with naming: 'compositorAn
dstockwell 2013/11/18 06:11:20 Done.
77 }; 87 };
78 88
89 inline Animation* toAnimation(TimedItem* timedItem)
90 {
91 ASSERT_WITH_SECURITY_IMPLICATION(timedItem && timedItem->isAnimation());
92 return static_cast<Animation*>(timedItem);
93 }
94
79 } // namespace WebCore 95 } // namespace WebCore
80 96
81 #endif 97 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698