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

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

Issue 1543143002: Blink CompositorAnimations: Do not crash if no compositor animation player. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « no previous file | no next file » | 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 if (!canStartAnimationOnCompositor(element)) { 376 if (!canStartAnimationOnCompositor(element)) {
377 // When an element is being detached, we cancel any associated 377 // When an element is being detached, we cancel any associated
378 // Animations for CSS animations. But by the time we get 378 // Animations for CSS animations. But by the time we get
379 // here the mapping will have been removed. 379 // here the mapping will have been removed.
380 // FIXME: Defer remove/pause operations until after the 380 // FIXME: Defer remove/pause operations until after the
381 // compositing update. 381 // compositing update.
382 return; 382 return;
383 } 383 }
384 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { 384 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
385 WebCompositorAnimationPlayer* compositorPlayer = animation.compositorPla yer(); 385 WebCompositorAnimationPlayer* compositorPlayer = animation.compositorPla yer();
386 ASSERT(compositorPlayer); 386 if (compositorPlayer)
387 compositorPlayer->removeAnimation(id); 387 compositorPlayer->removeAnimation(id);
388 } else { 388 } else {
389 toLayoutBoxModelObject(element.layoutObject())->layer()->compositedLayer Mapping()->mainGraphicsLayer()->removeAnimation(id); 389 toLayoutBoxModelObject(element.layoutObject())->layer()->compositedLayer Mapping()->mainGraphicsLayer()->removeAnimation(id);
390 } 390 }
391 } 391 }
392 392
393 void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& e lement, const Animation& animation, int id, double pauseTime) 393 void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& e lement, const Animation& animation, int id, double pauseTime)
394 { 394 {
395 // FIXME: canStartAnimationOnCompositor queries compositingState, which is n ot necessarily up to date. 395 // FIXME: canStartAnimationOnCompositor queries compositingState, which is n ot necessarily up to date.
396 // https://code.google.com/p/chromium/issues/detail?id=339847 396 // https://code.google.com/p/chromium/issues/detail?id=339847
397 DisableCompositingQueryAsserts disabler; 397 DisableCompositingQueryAsserts disabler;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 break; 757 break;
758 default: 758 default:
759 ASSERT_NOT_REACHED(); 759 ASSERT_NOT_REACHED();
760 } 760 }
761 animations.append(animation.release()); 761 animations.append(animation.release());
762 } 762 }
763 ASSERT(!animations.isEmpty()); 763 ASSERT(!animations.isEmpty());
764 } 764 }
765 765
766 } // namespace blink 766 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698