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

Unified Diff: Source/core/animation/DocumentAnimations.cpp

Issue 135693003: Defer starting of animations until after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Advance animation clock after minimum delay. 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/DocumentAnimations.cpp
diff --git a/Source/core/animation/DocumentAnimations.cpp b/Source/core/animation/DocumentAnimations.cpp
index 8bf72d2b7c61304bc17f3c35d19386e9fbcda9c5..38f402f53afe0db49b02285079bb330ff568ec62 100644
--- a/Source/core/animation/DocumentAnimations.cpp
+++ b/Source/core/animation/DocumentAnimations.cpp
@@ -50,8 +50,6 @@ void updateAnimationTiming(Document& document)
{
document.timeline()->serviceAnimations();
document.transitionTimeline()->serviceAnimations();
- if (!document.childNeedsStyleRecalc())
- document.animationClock().unfreeze();
}
void dispatchAnimationEvents(Document& document)
@@ -68,8 +66,10 @@ void dispatchAnimationEventsAsync(Document& document)
} // namespace
-void DocumentAnimations::serviceOnAnimationFrame(Document& document, double monotonicAnimationStartTime)
+void DocumentAnimations::serviceOnFrameStart(Document& document, double monotonicAnimationStartTime)
{
+ // FIXME: This seems fragile. Do we need a separate frame lifecycle?
+ ASSERT(document.lifecycle().state() == DocumentLifecycle::StyleClean || document.lifecycle().state() == DocumentLifecycle::StyleRecalcPending || document.lifecycle().state() == DocumentLifecycle::LayoutClean || document.lifecycle().state() == DocumentLifecycle::CompositingClean);
abarth-chromium 2014/02/20 17:52:00 What are you trying to assert here? As written, t
dstockwell 2014/02/20 18:22:01 I was looking at what we know about the beginning
document.animationClock().updateTime(monotonicAnimationStartTime);
updateAnimationTiming(document);
dispatchAnimationEvents(document);
@@ -90,8 +90,9 @@ void DocumentAnimations::serviceBeforeGetComputedStyle(Node& node, CSSPropertyID
}
}
-void DocumentAnimations::serviceAfterStyleRecalc(Document& document)
+void DocumentAnimations::serviceOnFrameEnd(Document& document)
{
+ ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean);
if (document.cssPendingAnimations().startPendingAnimations() && document.view())
document.view()->scheduleAnimation();

Powered by Google App Engine
This is Rietveld 408576698