| OLD | NEW | 
|   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  Loading... | 
|  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 // FIXME: Move these to CompositorAnimations | 
 |  47 bool shouldCompositeForActiveAnimations(const RenderObject&, bool renderViewInCo
    mpositingMode); | 
 |  48 bool hasActiveAnimations(const RenderObject&, CSSPropertyID); | 
 |  49 bool hasActiveAnimationsOnCompositor(const RenderObject&, CSSPropertyID); | 
 |  50  | 
|  43 class ActiveAnimations { |  51 class ActiveAnimations { | 
|  44 public: |  52 public: | 
|  45     // Animations that are currently active for this element, their effects will
     be applied |  53     // 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. |  54     // during a style recalc. CSS Transitions are included in this stack. | 
|  47     AnimationStack& defaultStack() { return m_defaultStack; } |  55     AnimationStack& defaultStack() { return m_defaultStack; } | 
|  48     // Tracks the state of active CSS Animations and Transitions. The individual
     animations |  56     // 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 |  57     // will also be part of the default stack, but the mapping betwen animation 
    name and | 
|  50     // player is kept here. |  58     // player is kept here. | 
|  51     CSSAnimations& cssAnimations() { return m_cssAnimations; } |  59     CSSAnimations& cssAnimations() { return m_cssAnimations; } | 
 |  60     const CSSAnimations& cssAnimations() const { return m_cssAnimations; } | 
|  52  |  61  | 
|  53     typedef HashCountedSet<Player*> PlayerSet; |  62     typedef HashCountedSet<Player*> PlayerSet; | 
|  54     // Players which have animations targeting this element. |  63     // Players which have animations targeting this element. | 
|  55     const PlayerSet& players() const { return m_players; } |  64     const PlayerSet& players() const { return m_players; } | 
|  56     PlayerSet& players() { return m_players; } |  65     PlayerSet& players() { return m_players; } | 
|  57  |  66  | 
|  58     bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
    Empty(); } |  67     bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
    Empty(); } | 
 |  68  | 
 |  69     bool hasActiveAnimations(CSSPropertyID) const; | 
 |  70     bool hasActiveAnimationsOnCompositor(CSSPropertyID) const; | 
 |  71     void cancelAnimationOnCompositor(); | 
 |  72  | 
|  59 private: |  73 private: | 
|  60     AnimationStack m_defaultStack; |  74     AnimationStack m_defaultStack; | 
|  61     CSSAnimations m_cssAnimations; |  75     CSSAnimations m_cssAnimations; | 
|  62     PlayerSet m_players; |  76     PlayerSet m_players; | 
|  63 }; |  77 }; | 
|  64  |  78  | 
|  65 } // namespace WebCore |  79 } // namespace WebCore | 
|  66  |  80  | 
|  67 #endif |  81 #endif | 
| OLD | NEW |