From 4b31027fae9959cd6ced6a16c3d77f0c525ead25 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 26 Jan 2016 21:19:00 +0100 Subject: [PATCH] Bug 1216842 - Part 7: Add easing function to laryer::Animation. r=cam --- gfx/layers/composite/AsyncCompositionManager.cpp | 4 ++++ gfx/layers/ipc/LayersMessages.ipdlh | 2 ++ layout/base/nsDisplayList.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 66be26ffea8e..f4db3f916e49 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -23,6 +23,7 @@ #include "mozilla/layers/APZUtils.h" // for CompleteAsyncTransform #include "mozilla/layers/Compositor.h" // for Compositor #include "mozilla/layers/CompositorParent.h" // for CompositorParent, etc +#include "mozilla/layers/LayerAnimationUtils.h" // for TimingFunctionToComputedTimingFunction #include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper #include "nsCoord.h" // for NSAppUnitsToFloatPixels, etc #include "nsDebug.h" // for NS_ASSERTION, etc @@ -595,6 +596,9 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint) // example, while they are waiting to be removed) we currently just // assume that we should fill. timing.mFill = dom::FillMode::Both; + timing.mFunction = + AnimationUtils::TimingFunctionToComputedTimingFunction( + animation.easingFunction()); ComputedTiming computedTiming = dom::KeyframeEffectReadOnly::GetComputedTimingAt( diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index 098e033f58a8..796426a67cc3 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -200,6 +200,8 @@ struct Animation { nsCSSProperty property; AnimationData data; float playbackRate; + // This is used in the transformed progress calculation. + TimingFunction easingFunction; }; // Change a layer's attributes diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 16266f8fc68c..e56b70c8e7ea 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -401,6 +401,7 @@ AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty, 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];