| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/animation/ActiveAnimations.h" | 32 #include "core/animation/ActiveAnimations.h" |
| 33 | 33 |
| 34 #include "core/frame/animation/AnimationController.h" | 34 #include "core/frame/animation/AnimationController.h" |
| 35 #include "core/rendering/RenderObject.h" | 35 #include "core/rendering/RenderObject.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 bool shouldCompositeForActiveAnimations(const RenderObject& renderer, bool rende
rViewInCompositingMode) | 39 bool shouldCompositeForActiveAnimations(const RenderObject& renderer) |
| 40 { | 40 { |
| 41 ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled()); | 41 ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled()); |
| 42 | 42 |
| 43 if (!renderer.node() || !renderer.node()->isElementNode()) | 43 if (!renderer.node() || !renderer.node()->isElementNode()) |
| 44 return false; | 44 return false; |
| 45 | 45 |
| 46 const Element* element = toElement(renderer.node()); | 46 const Element* element = toElement(renderer.node()); |
| 47 if (const ActiveAnimations* activeAnimations = element->activeAnimations())
{ | 47 if (const ActiveAnimations* activeAnimations = element->activeAnimations())
{ |
| 48 // FIXME: remove compositing mode check once compositing is forced on al
l platforms | 48 if (activeAnimations->hasActiveAnimations(CSSPropertyOpacity) |
| 49 if ((renderViewInCompositingMode && activeAnimations->hasActiveAnimation
s(CSSPropertyOpacity)) | |
| 50 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitTransform) | 49 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitTransform) |
| 51 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitFilter)) | 50 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitFilter)) |
| 52 return true; | 51 return true; |
| 53 } | 52 } |
| 54 | 53 |
| 55 return false; | 54 return false; |
| 56 } | 55 } |
| 57 | 56 |
| 58 bool hasActiveAnimations(const RenderObject& renderer, CSSPropertyID property) | 57 bool hasActiveAnimations(const RenderObject& renderer, CSSPropertyID property) |
| 59 { | 58 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return m_defaultStack.hasActiveAnimationsOnCompositor(property); | 92 return m_defaultStack.hasActiveAnimationsOnCompositor(property); |
| 94 } | 93 } |
| 95 | 94 |
| 96 void ActiveAnimations::cancelAnimationOnCompositor() | 95 void ActiveAnimations::cancelAnimationOnCompositor() |
| 97 { | 96 { |
| 98 for (PlayerSet::iterator it = m_players.begin(); it != players().end(); ++it
) | 97 for (PlayerSet::iterator it = m_players.begin(); it != players().end(); ++it
) |
| 99 it->key->cancelAnimationOnCompositor(); | 98 it->key->cancelAnimationOnCompositor(); |
| 100 } | 99 } |
| 101 | 100 |
| 102 } // namespace WebCore | 101 } // namespace WebCore |
| OLD | NEW |