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

Side by Side Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed config.gni. Minor cleanups. Created 6 years, 5 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
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 calculateAnimationActiveInterpolations(update.get(), element, parentElement. document().timeline().currentTimeInternal()); 229 calculateAnimationActiveInterpolations(update.get(), element, parentElement. document().timeline().currentTimeInternal());
230 calculateTransitionUpdate(update.get(), element, style); 230 calculateTransitionUpdate(update.get(), element, style);
231 calculateTransitionActiveInterpolations(update.get(), element, parentElement .document().timeline().currentTimeInternal()); 231 calculateTransitionActiveInterpolations(update.get(), element, parentElement .document().timeline().currentTimeInternal());
232 return update->isEmpty() ? nullptr : update.release(); 232 return update->isEmpty() ? nullptr : update.release();
233 } 233 }
234 234
235 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element * element, const Element& parentElement, const RenderStyle& style, RenderStyle* parentStyle, StyleResolver* resolver) 235 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element * element, const Element& parentElement, const RenderStyle& style, RenderStyle* parentStyle, StyleResolver* resolver)
236 { 236 {
237 const ActiveAnimations* activeAnimations = element ? element->activeAnimatio ns() : 0; 237 const ActiveAnimations* activeAnimations = element ? element->activeAnimatio ns() : 0;
238 238
239 #if !ASSERT_ENABLED 239 #if !ENABLE(ASSERT)
240 // If we're in an animation style change, no animations can have started, be en cancelled or changed play state. 240 // If we're in an animation style change, no animations can have started, be en cancelled or changed play state.
241 // When ASSERT is enabled, we verify this optimization. 241 // When ASSERT is enabled, we verify this optimization.
242 if (activeAnimations && activeAnimations->isAnimationStyleChange()) 242 if (activeAnimations && activeAnimations->isAnimationStyleChange())
243 return; 243 return;
244 #endif 244 #endif
245 245
246 const CSSAnimationData* animationData = style.animations(); 246 const CSSAnimationData* animationData = style.animations();
247 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c ssAnimations() : 0; 247 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c ssAnimations() : 0;
248 248
249 HashSet<AtomicString> inactive; 249 HashSet<AtomicString> inactive;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 453
454 void CSSAnimations::calculateTransitionUpdate(CSSAnimationUpdate* update, const Element* element, const RenderStyle& style) 454 void CSSAnimations::calculateTransitionUpdate(CSSAnimationUpdate* update, const Element* element, const RenderStyle& style)
455 { 455 {
456 if (!element) 456 if (!element)
457 return; 457 return;
458 458
459 ActiveAnimations* activeAnimations = element->activeAnimations(); 459 ActiveAnimations* activeAnimations = element->activeAnimations();
460 const TransitionMap* activeTransitions = activeAnimations ? &activeAnimation s->cssAnimations().m_transitions : 0; 460 const TransitionMap* activeTransitions = activeAnimations ? &activeAnimation s->cssAnimations().m_transitions : 0;
461 const CSSTransitionData* transitionData = style.transitions(); 461 const CSSTransitionData* transitionData = style.transitions();
462 462
463 #if ASSERT_ENABLED 463 #if ENABLE(ASSERT)
464 // In debug builds we verify that it would have been safe to avoid populatin g and testing listedProperties if the style recalc is due to animation. 464 // In debug builds we verify that it would have been safe to avoid populatin g and testing listedProperties if the style recalc is due to animation.
465 const bool animationStyleRecalc = false; 465 const bool animationStyleRecalc = false;
466 #else 466 #else
467 // In release builds we avoid the cost of checking for new and interrupted t ransitions if the style recalc is due to animation. 467 // In release builds we avoid the cost of checking for new and interrupted t ransitions if the style recalc is due to animation.
468 const bool animationStyleRecalc = activeAnimations && activeAnimations->isAn imationStyleChange(); 468 const bool animationStyleRecalc = activeAnimations && activeAnimations->isAn imationStyleChange();
469 #endif 469 #endif
470 470
471 BitArray<numCSSProperties> listedProperties; 471 BitArray<numCSSProperties> listedProperties;
472 bool anyTransitionHadTransitionAll = false; 472 bool anyTransitionHadTransitionAll = false;
473 const RenderObject* renderer = element->renderer(); 473 const RenderObject* renderer = element->renderer();
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 void CSSAnimationUpdate::trace(Visitor* visitor) 837 void CSSAnimationUpdate::trace(Visitor* visitor)
838 { 838 {
839 visitor->trace(m_newTransitions); 839 visitor->trace(m_newTransitions);
840 visitor->trace(m_activeInterpolationsForAnimations); 840 visitor->trace(m_activeInterpolationsForAnimations);
841 visitor->trace(m_activeInterpolationsForTransitions); 841 visitor->trace(m_activeInterpolationsForTransitions);
842 visitor->trace(m_newAnimations); 842 visitor->trace(m_newAnimations);
843 visitor->trace(m_cancelledAnimationPlayers); 843 visitor->trace(m_cancelledAnimationPlayers);
844 } 844 }
845 845
846 } // namespace WebCore 846 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698