mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1216842 - Part 7: Add easing function to laryer::Animation. r=cam
This commit is contained in:
parent
15210ae758
commit
4b31027fae
@ -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(
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user