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

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 1698093005: Discard SampledEffects on elements if they are redundant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_renameToSampledEffect
Patch Set: Rebased Created 4 years, 10 months 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
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // that will be, however, so the parent will need to supply it. 255 // that will be, however, so the parent will need to supply it.
256 return forwards 256 return forwards
257 ? std::numeric_limits<double>::infinity() 257 ? std::numeric_limits<double>::infinity()
258 : localTime - end; 258 : localTime - end;
259 default: 259 default:
260 ASSERT_NOT_REACHED(); 260 ASSERT_NOT_REACHED();
261 return std::numeric_limits<double>::infinity(); 261 return std::numeric_limits<double>::infinity();
262 } 262 }
263 } 263 }
264 264
265 void KeyframeEffect::notifySampledEffectRemovedFromAnimationStack()
266 {
267 m_sampledEffect = nullptr;
268 }
269
265 #if !ENABLE(OILPAN) 270 #if !ENABLE(OILPAN)
266 void KeyframeEffect::notifyElementDestroyed() 271 void KeyframeEffect::notifyElementDestroyed()
267 { 272 {
268 // If our animation is kept alive just by the sampledEffect, we might get ou r 273 // If our animation is kept alive just by the sampledEffect, we might get ou r
269 // destructor called when we call SampledEffect::clear(), so we need to 274 // destructor called when we call SampledEffect::clear(), so we need to
270 // clear m_sampledEffect first. 275 // clear m_sampledEffect first.
271 m_target = nullptr; 276 m_target = nullptr;
272 clearEventDelegate(); 277 clearEventDelegate();
273 SampledEffect* sampledEffect = m_sampledEffect; 278 SampledEffect* sampledEffect = m_sampledEffect;
274 m_sampledEffect = nullptr; 279 m_sampledEffect = nullptr;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 379
375 DEFINE_TRACE(KeyframeEffect) 380 DEFINE_TRACE(KeyframeEffect)
376 { 381 {
377 visitor->trace(m_target); 382 visitor->trace(m_target);
378 visitor->trace(m_model); 383 visitor->trace(m_model);
379 visitor->trace(m_sampledEffect); 384 visitor->trace(m_sampledEffect);
380 AnimationEffect::trace(visitor); 385 AnimationEffect::trace(visitor);
381 } 386 }
382 387
383 } // namespace blink 388 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/KeyframeEffect.h ('k') | third_party/WebKit/Source/core/animation/SampledEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698