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

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

Issue 110123005: Web Animations CSS: Record if style recalc is for animation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Ignore new interrupted immediately test when testing legacy animations engine Created 7 years 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
« no previous file with comments | « Source/core/animation/ActiveAnimations.h ('k') | Source/core/animation/css/CSSAnimations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (player() && !previouslyInEffect) { 81 if (player() && !previouslyInEffect) {
82 ensureAnimationStack(m_target.get()).add(this); 82 ensureAnimationStack(m_target.get()).add(this);
83 m_activeInAnimationStack = true; 83 m_activeInAnimationStack = true;
84 } 84 }
85 85
86 double iteration = currentIteration(); 86 double iteration = currentIteration();
87 ASSERT(iteration >= 0); 87 ASSERT(iteration >= 0);
88 // FIXME: Handle iteration values which overflow int. 88 // FIXME: Handle iteration values which overflow int.
89 m_compositableValues = m_effect->sample(static_cast<int>(iteration), timeFra ction()); 89 m_compositableValues = m_effect->sample(static_cast<int>(iteration), timeFra ction());
90 if (player()) { 90 if (player()) {
91 m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer) ; 91 m_target->setNeedsAnimationStyleRecalc();
92 return true; 92 return true;
93 } 93 }
94 return false; 94 return false;
95 } 95 }
96 96
97 void Animation::clearEffects() 97 void Animation::clearEffects()
98 { 98 {
99 ASSERT(player()); 99 ASSERT(player());
100 ASSERT(m_activeInAnimationStack); 100 ASSERT(m_activeInAnimationStack);
101 ensureAnimationStack(m_target.get()).remove(this); 101 ensureAnimationStack(m_target.get()).remove(this);
102 cancelAnimationOnCompositor(); 102 cancelAnimationOnCompositor();
103 m_activeInAnimationStack = false; 103 m_activeInAnimationStack = false;
104 m_compositableValues.clear(); 104 m_compositableValues.clear();
105 m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer); 105 m_target->setNeedsAnimationStyleRecalc();
106 } 106 }
107 107
108 bool Animation::updateChildrenAndEffects() const 108 bool Animation::updateChildrenAndEffects() const
109 { 109 {
110 if (!m_effect) 110 if (!m_effect)
111 return false; 111 return false;
112 112
113 if (isInEffect()) 113 if (isInEffect())
114 return const_cast<Animation*>(this)->applyEffects(m_activeInAnimationSta ck); 114 return const_cast<Animation*>(this)->applyEffects(m_activeInAnimationSta ck);
115 115
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) 194 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime)
195 { 195 {
196 ASSERT(hasActiveAnimationsOnCompositor()); 196 ASSERT(hasActiveAnimationsOnCompositor());
197 if (!m_target || !m_target->renderer()) 197 if (!m_target || !m_target->renderer())
198 return; 198 return;
199 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) 199 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i)
200 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime); 200 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime);
201 } 201 }
202 202
203 } // namespace WebCore 203 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/ActiveAnimations.h ('k') | Source/core/animation/css/CSSAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698