| 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 28 matching lines...) Expand all Loading... |
| 39 bool shouldCompositeForActiveAnimations(const RenderObject& renderer, bool rende
rViewInCompositingMode) | 39 bool shouldCompositeForActiveAnimations(const RenderObject& renderer, bool rende
rViewInCompositingMode) |
| 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 // FIXME: remove compositing mode check once compositing is forced on al
l platforms |
| 49 bool shouldCompositeForActiveAnimation = (activeAnimations->hasActiveAni
mations(CSSPropertyOpacity) && renderViewInCompositingMode) | 49 if ((renderViewInCompositingMode && activeAnimations->hasActiveAnimation
s(CSSPropertyOpacity)) |
| 50 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitTransform) | 50 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitTransform) |
| 51 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitFilter); | 51 || activeAnimations->hasActiveAnimations(CSSPropertyWebkitFilter)) |
| 52 return shouldCompositeForActiveAnimation || activeAnimations->cssAnimati
ons().shouldCompositeForPendingAnimations(renderViewInCompositingMode); | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool hasActiveAnimations(const RenderObject& renderer, CSSPropertyID property) | 58 bool hasActiveAnimations(const RenderObject& renderer, CSSPropertyID property) |
| 59 { | 59 { |
| 60 ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled()); | 60 ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled()); |
| 61 | 61 |
| 62 if (!renderer.node() || !renderer.node()->isElementNode()) | 62 if (!renderer.node() || !renderer.node()->isElementNode()) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 93 return m_defaultStack.hasActiveAnimationsOnCompositor(property); | 93 return m_defaultStack.hasActiveAnimationsOnCompositor(property); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void ActiveAnimations::cancelAnimationOnCompositor() | 96 void ActiveAnimations::cancelAnimationOnCompositor() |
| 97 { | 97 { |
| 98 for (PlayerSet::iterator it = m_players.begin(); it != players().end(); ++it
) | 98 for (PlayerSet::iterator it = m_players.begin(); it != players().end(); ++it
) |
| 99 it->key->cancelAnimationOnCompositor(); | 99 it->key->cancelAnimationOnCompositor(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace WebCore | 102 } // namespace WebCore |
| OLD | NEW |