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

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

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 22 matching lines...) Expand all
33 33
34 #include "core/animation/AnimationStack.h" 34 #include "core/animation/AnimationStack.h"
35 #include "core/animation/css/CSSAnimations.h" 35 #include "core/animation/css/CSSAnimations.h"
36 #include "wtf/HashCountedSet.h" 36 #include "wtf/HashCountedSet.h"
37 #include "wtf/HashMap.h" 37 #include "wtf/HashMap.h"
38 #include "wtf/RefPtr.h" 38 #include "wtf/RefPtr.h"
39 #include "wtf/Vector.h" 39 #include "wtf/Vector.h"
40 40
41 namespace WebCore { 41 namespace WebCore {
42 42
43 class RenderObject;
44 class Element;
45
46 bool isRunningAnimation(const RenderObject&, CSSPropertyID = CSSPropertyInvalid) ;
47 bool isRunningCompositorAnimation(const RenderObject&, CSSPropertyID = CSSProper tyInvalid);
48
43 class ActiveAnimations { 49 class ActiveAnimations {
44 public: 50 public:
45 // Animations that are currently active for this element, their effects will be applied 51 // Animations that are currently active for this element, their effects will be applied
46 // during a style recalc. CSS Transitions are included in this stack. 52 // during a style recalc. CSS Transitions are included in this stack.
47 AnimationStack& defaultStack() { return m_defaultStack; } 53 AnimationStack& defaultStack() { return m_defaultStack; }
48 // Tracks the state of active CSS Animations and Transitions. The individual animations 54 // Tracks the state of active CSS Animations and Transitions. The individual animations
49 // will also be part of the default stack, but the mapping betwen animation name and 55 // will also be part of the default stack, but the mapping betwen animation name and
50 // player is kept here. 56 // player is kept here.
51 CSSAnimations& cssAnimations() { return m_cssAnimations; } 57 CSSAnimations& cssAnimations() { return m_cssAnimations; }
52 58
53 typedef HashCountedSet<Player*> PlayerSet; 59 typedef HashCountedSet<Player*> PlayerSet;
54 // Players which have animations targeting this element. 60 // Players which have animations targeting this element.
55 const PlayerSet& players() const { return m_players; } 61 const PlayerSet& players() const { return m_players; }
56 PlayerSet& players() { return m_players; } 62 PlayerSet& players() { return m_players; }
57 63
58 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty(); } 64 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty(); }
65
66 bool hasCandidateForCompositorAnimation() const;
67 bool isRunningAnimation(CSSPropertyID) const;
68 bool isRunningCompositorAnimation(const Element*, CSSPropertyID) const;
69 void cancelCompositorAnimations();
70
59 private: 71 private:
60 AnimationStack m_defaultStack; 72 AnimationStack m_defaultStack;
61 CSSAnimations m_cssAnimations; 73 CSSAnimations m_cssAnimations;
62 PlayerSet m_players; 74 PlayerSet m_players;
63 }; 75 };
64 76
65 } // namespace WebCore 77 } // namespace WebCore
66 78
67 #endif 79 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/ActiveAnimations.cpp » ('j') | Source/core/animation/ActiveAnimations.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698