Bug 1223658 - Part 5: Pass fillMode in compositor thread as well. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 11 Apr 2016 10:35:13 +0900
changeset 349295 d8c65ee29fa275a6779df31e8e4f3ee93e4fa0cb
parent 349294 1f9eb6ec7aa07310d0b9fa58f656f5d072115f7a
child 349296 7d0a5ccf428602974ab29885e9ec6555d4b101f1
push id15036
push userbmo:hiikezoe@mozilla-japan.org
push dateMon, 11 Apr 2016 01:43:31 +0000
reviewersbirtles
bugs1223658
milestone48.0a1
Bug 1223658 - Part 5: Pass fillMode in compositor thread as well. r?birtles Before this patch we've been using fill mode both on the compositor. Once we send animations to the compositor in before phase, we have to send fill mode to know correct state in the before phase. MozReview-Commit-ID: 1i7YTWboira
gfx/layers/composite/AsyncCompositionManager.cpp
gfx/layers/ipc/LayersMessages.ipdlh
layout/base/nsDisplayList.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -572,21 +572,17 @@ SampleAnimations(Layer* aLayer, TimeStam
 
     TimingParams timing;
     timing.mDuration.emplace(animation.duration());
     timing.mDelay = animation.delay();
     timing.mIterations = animation.iterations();
     timing.mIterationStart = animation.iterationStart();
     timing.mDirection =
       static_cast<dom::PlaybackDirection>(animation.direction());
-    // Animations typically only run on the compositor during their active
-    // interval but if we end up sampling them outside that range (for
-    // example, while they are waiting to be removed) we currently just
-    // assume that we should fill.
-    timing.mFill = dom::FillMode::Both;
+    timing.mFill = static_cast<dom::FillMode>(animation.fillMode());
     timing.mFunction =
       AnimationUtils::TimingFunctionToComputedTimingFunction(
         animation.easingFunction());
 
     ComputedTiming computedTiming =
       dom::KeyframeEffectReadOnly::GetComputedTimingAt(
         Nullable<TimeDuration>(elapsedDuration), timing);
 
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -191,16 +191,17 @@ struct Animation {
   AnimationSegment[] segments;
   // Number of times to repeat the animation, including positive infinity.
   // Values <= 0 mean the animation will not play (although events are still
   // dispatched on the main thread).
   float iterations;
   float iterationStart;
   // This uses the NS_STYLE_ANIMATION_DIRECTION_* constants.
   int32_t direction;
+  int32_t fillMode;
   nsCSSProperty property;
   AnimationData data;
   float playbackRate;
   // This is used in the transformed progress calculation.
   TimingFunction easingFunction;
 };
 
 // Change a layer's attributes
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -392,16 +392,17 @@ AddAnimationForProperty(nsIFrame* aFrame
                            : aAnimation->AnimationTimeToTimeStamp(
                               StickyTimeDuration(0));
   animation->delay() = timing.mDelay;
   animation->initialCurrentTime() = aAnimation->GetCurrentTime().Value();
   animation->duration() = computedTiming.mDuration;
   animation->iterations() = computedTiming.mIterations;
   animation->iterationStart() = computedTiming.mIterationStart;
   animation->direction() = static_cast<uint32_t>(timing.mDirection);
+  animation->fillMode() = static_cast<int32_t>(timing.mFill);
   animation->property() = aProperty.mProperty;
   animation->playbackRate() = aAnimation->PlaybackRate();
   animation->data() = aData;
   animation->easingFunction() = ToTimingFunction(timing.mFunction);
 
   for (uint32_t segIdx = 0; segIdx < aProperty.mSegments.Length(); segIdx++) {
     const AnimationPropertySegment& segment = aProperty.mSegments[segIdx];