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

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp

Issue 10310152: Merge 116786 - [chromium] Ensure that animations continue to run when transform-style is changed (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp (revision 116996)
+++ Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp (working copy)
@@ -116,7 +116,8 @@
} // namepace
CCLayerAnimationController::CCLayerAnimationController(CCLayerAnimationControllerClient* client)
- : m_client(client)
+ : m_forceSync(false)
+ , m_client(client)
{
}
@@ -195,9 +196,14 @@
// are kept in sync.
void CCLayerAnimationController::pushAnimationUpdatesTo(CCLayerAnimationController* controllerImpl)
{
- pushNewAnimationsToImplThread(controllerImpl);
- removeAnimationsCompletedOnMainThread(controllerImpl);
- pushPropertiesToImplThread(controllerImpl);
+ if (m_forceSync) {
+ replaceImplThreadAnimations(controllerImpl);
+ m_forceSync = false;
+ } else {
+ pushNewAnimationsToImplThread(controllerImpl);
+ removeAnimationsCompletedOnMainThread(controllerImpl);
+ pushPropertiesToImplThread(controllerImpl);
+ }
}
void CCLayerAnimationController::animate(double monotonicTime, CCAnimationEventsVector* events)
@@ -245,8 +251,7 @@
void CCLayerAnimationController::notifyAnimationStarted(const CCAnimationEvent& event)
{
for (size_t i = 0; i < m_activeAnimations.size(); ++i) {
- if (m_activeAnimations[i]->group() == event.groupId && m_activeAnimations[i]->targetProperty() == event.targetProperty) {
- ASSERT(m_activeAnimations[i]->needsSynchronizedStartTime());
+ if (m_activeAnimations[i]->group() == event.groupId && m_activeAnimations[i]->targetProperty() == event.targetProperty && m_activeAnimations[i]->needsSynchronizedStartTime()) {
m_activeAnimations[i]->setNeedsSynchronizedStartTime(false);
m_activeAnimations[i]->setStartTime(event.monotonicTime);
return;
@@ -254,6 +259,11 @@
}
}
+void CCLayerAnimationController::setClient(CCLayerAnimationControllerClient* client)
+{
+ m_client = client;
+}
+
void CCLayerAnimationController::pushNewAnimationsToImplThread(CCLayerAnimationController* controllerImpl) const
{
// Any new animations owned by the main thread's controller are cloned and adde to the impl thread's controller.
@@ -273,6 +283,7 @@
ASSERT(!toAdd->needsSynchronizedStartTime());
// The new animation should be set to run as soon as possible.
toAdd->setRunState(CCActiveAnimation::WaitingForTargetAvailability, 0);
+ toAdd->setStartTime(0);
controllerImpl->add(toAdd.release());
}
}
@@ -429,6 +440,13 @@
}
}
+void CCLayerAnimationController::replaceImplThreadAnimations(CCLayerAnimationController* controllerImpl) const
+{
+ controllerImpl->m_activeAnimations.clear();
+ for (size_t i = 0; i < m_activeAnimations.size(); ++i)
+ controllerImpl->add(m_activeAnimations[i]->cloneForImplThread());
+}
+
void CCLayerAnimationController::tickAnimations(double monotonicTime)
{
for (size_t i = 0; i < m_activeAnimations.size(); ++i) {
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h ('k') | Source/WebKit/chromium/WebKit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698