Bug 927349 part 19 - Don't add pending animations to layers when their refresh driver is under test control; r=jwatt

This commit is contained in:
Brian Birtles 2014-12-22 09:35:42 +09:00
parent 83ead697c2
commit 24eaa57ecc
2 changed files with 19 additions and 1 deletions

View File

@ -65,9 +65,10 @@ public:
// be a no-op.
void FastForward(const TimeStamp& aTimeStamp);
nsRefreshDriver* GetRefreshDriver() const;
protected:
TimeStamp GetCurrentTimeStamp() const;
nsRefreshDriver* GetRefreshDriver() const;
nsCOMPtr<nsIDocument> mDocument;

View File

@ -424,6 +424,23 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
player->IsRunning())) {
continue;
}
// Don't add animations that are pending when their corresponding
// refresh driver is under test control. This is because any pending
// animations on layers will have their start time updated with the
// current timestamp but when the refresh driver is under test control
// its refresh times are unrelated to timestamp values.
//
// Instead we leave the animation running on the main thread and the
// next time the refresh driver is advanced it will trigger any pending
// animations.
if (player->PlayState() == AnimationPlayState::Pending) {
nsRefreshDriver* driver = player->Timeline()->GetRefreshDriver();
if (driver && driver->IsTestControllingRefreshesEnabled()) {
continue;
}
}
AddAnimationForProperty(aFrame, aProperty, player, aLayer, aData, aPending);
player->SetIsRunningOnCompositor();
}