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

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

Issue 182293002: Make Element::ensureActiveAnimations() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/resolver/StyleResolver.cpp » ('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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 , m_target(target) 322 , m_target(target)
323 , m_effect(effect) 323 , m_effect(effect)
324 , m_activeInAnimationStack(false) 324 , m_activeInAnimationStack(false)
325 , m_priority(priority) 325 , m_priority(priority)
326 { 326 {
327 } 327 }
328 328
329 void Animation::didAttach() 329 void Animation::didAttach()
330 { 330 {
331 if (m_target) 331 if (m_target)
332 m_target->ensureActiveAnimations()->players().add(player()); 332 m_target->ensureActiveAnimations().players().add(player());
333 } 333 }
334 334
335 void Animation::willDetach() 335 void Animation::willDetach()
336 { 336 {
337 if (m_target) 337 if (m_target)
338 m_target->activeAnimations()->players().remove(player()); 338 m_target->activeAnimations()->players().remove(player());
339 if (m_activeInAnimationStack) 339 if (m_activeInAnimationStack)
340 clearEffects(); 340 clearEffects();
341 } 341 }
342 342
343 static AnimationStack& ensureAnimationStack(Element* element) 343 static AnimationStack& ensureAnimationStack(Element* element)
344 { 344 {
345 return element->ensureActiveAnimations()->defaultStack(); 345 return element->ensureActiveAnimations().defaultStack();
346 } 346 }
347 347
348 void Animation::applyEffects(bool previouslyInEffect) 348 void Animation::applyEffects(bool previouslyInEffect)
349 { 349 {
350 ASSERT(isInEffect()); 350 ASSERT(isInEffect());
351 if (!m_target || !m_effect) 351 if (!m_target || !m_effect)
352 return; 352 return;
353 353
354 if (player() && !previouslyInEffect) { 354 if (player() && !previouslyInEffect) {
355 ensureAnimationStack(m_target.get()).add(this); 355 ensureAnimationStack(m_target.get()).add(this);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) 478 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime)
479 { 479 {
480 ASSERT(hasActiveAnimationsOnCompositor()); 480 ASSERT(hasActiveAnimationsOnCompositor());
481 if (!m_target || !m_target->renderer()) 481 if (!m_target || !m_target->renderer())
482 return; 482 return;
483 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) 483 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i)
484 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime); 484 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime);
485 } 485 }
486 486
487 } // namespace WebCore 487 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698