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

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

Issue 73643004: Web Animations: Extract an API for servicing animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switch to references for non-null params. 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 28 matching lines...) Expand all
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;
Steve Block 2013/11/20 00:36:16 I don't understand why we no longer check whether
dstockwell 2013/11/20 00:49:16 The animations in CSSPendingAnimations are now act
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/Animation.h » ('j') | Source/core/animation/DocumentAnimations.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698