Bug 1626165 - Part 1: Use move for aAnimationValues in StoreAnimatedValue(). r=layout-reviewers,firefox-animation-reviewers,hiro
We will store the sampled animations (for transforms) in AnimatedValue. So let's change the API to move this array, and so we can just move it into AnimationTransform in the following patch. No behavior change. Differential Revision: https://phabricator.services.mozilla.com/D209888
This commit is contained in:
@@ -317,7 +317,7 @@ AnimationHelper::SampleResult AnimationHelper::SampleAnimationForEachNode(
|
|||||||
const MutexAutoLock& aProofOfMapLock, TimeStamp aPreviousFrameTime,
|
const MutexAutoLock& aProofOfMapLock, TimeStamp aPreviousFrameTime,
|
||||||
TimeStamp aCurrentFrameTime, const AnimatedValue* aPreviousValue,
|
TimeStamp aCurrentFrameTime, const AnimatedValue* aPreviousValue,
|
||||||
nsTArray<PropertyAnimationGroup>& aPropertyAnimationGroups,
|
nsTArray<PropertyAnimationGroup>& aPropertyAnimationGroups,
|
||||||
nsTArray<RefPtr<StyleAnimationValue>>& aAnimationValues /* out */) {
|
SampledAnimationArray& aAnimationValues /* output */) {
|
||||||
MOZ_ASSERT(!aPropertyAnimationGroups.IsEmpty(),
|
MOZ_ASSERT(!aPropertyAnimationGroups.IsEmpty(),
|
||||||
"Should be called with animation data");
|
"Should be called with animation data");
|
||||||
MOZ_ASSERT(aAnimationValues.IsEmpty(),
|
MOZ_ASSERT(aAnimationValues.IsEmpty(),
|
||||||
@@ -600,8 +600,8 @@ uint64_t AnimationHelper::GetNextCompositorAnimationsId() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gfx::Matrix4x4 AnimationHelper::ServoAnimationValueToMatrix4x4(
|
gfx::Matrix4x4 AnimationHelper::ServoAnimationValueToMatrix4x4(
|
||||||
const nsTArray<RefPtr<StyleAnimationValue>>& aValues,
|
const SampledAnimationArray& aValues, const TransformData& aTransformData,
|
||||||
const TransformData& aTransformData, gfx::Path* aCachedMotionPath) {
|
gfx::Path* aCachedMotionPath) {
|
||||||
using nsStyleTransformMatrix::TransformReferenceBox;
|
using nsStyleTransformMatrix::TransformReferenceBox;
|
||||||
|
|
||||||
// This is a bit silly just to avoid the transform list copy from the
|
// This is a bit silly just to avoid the transform list copy from the
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ class APZSampler;
|
|||||||
class CompositorAnimationStorage;
|
class CompositorAnimationStorage;
|
||||||
struct AnimatedValue;
|
struct AnimatedValue;
|
||||||
|
|
||||||
typedef nsTArray<layers::Animation> AnimationArray;
|
using AnimationArray = nsTArray<layers::Animation>;
|
||||||
|
using SampledAnimationArray = AutoTArray<RefPtr<StyleAnimationValue>, 1>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This utility class allows reusing code between the webrender and
|
* This utility class allows reusing code between the webrender and
|
||||||
@@ -100,7 +101,7 @@ class AnimationHelper {
|
|||||||
const MutexAutoLock& aProofOfMapLock, TimeStamp aPreviousFrameTime,
|
const MutexAutoLock& aProofOfMapLock, TimeStamp aPreviousFrameTime,
|
||||||
TimeStamp aCurrentFrameTime, const AnimatedValue* aPreviousValue,
|
TimeStamp aCurrentFrameTime, const AnimatedValue* aPreviousValue,
|
||||||
nsTArray<PropertyAnimationGroup>& aPropertyAnimationGroups,
|
nsTArray<PropertyAnimationGroup>& aPropertyAnimationGroups,
|
||||||
nsTArray<RefPtr<StyleAnimationValue>>& aAnimationValues);
|
SampledAnimationArray& aAnimationValues /* output */);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract organized animation data by property into an array of
|
* Extract organized animation data by property into an array of
|
||||||
@@ -161,8 +162,8 @@ class AnimationHelper {
|
|||||||
* (e.g. transform, translate etc.).
|
* (e.g. transform, translate etc.).
|
||||||
*/
|
*/
|
||||||
static gfx::Matrix4x4 ServoAnimationValueToMatrix4x4(
|
static gfx::Matrix4x4 ServoAnimationValueToMatrix4x4(
|
||||||
const nsTArray<RefPtr<StyleAnimationValue>>& aValue,
|
const SampledAnimationArray& aValue, const TransformData& aTransformData,
|
||||||
const TransformData& aTransformData, gfx::Path* aCachedMotionPath);
|
gfx::Path* aCachedMotionPath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if |aPrerenderedRect| transformed by |aTransform| were
|
* Returns true if |aPrerenderedRect| transformed by |aTransform| were
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ static ParentLayerRect GetClipRectForPartialPrerender(
|
|||||||
void CompositorAnimationStorage::StoreAnimatedValue(
|
void CompositorAnimationStorage::StoreAnimatedValue(
|
||||||
nsCSSPropertyID aProperty, uint64_t aId,
|
nsCSSPropertyID aProperty, uint64_t aId,
|
||||||
const std::unique_ptr<AnimationStorageData>& aAnimationStorageData,
|
const std::unique_ptr<AnimationStorageData>& aAnimationStorageData,
|
||||||
const AutoTArray<RefPtr<StyleAnimationValue>, 1>& aAnimationValues,
|
SampledAnimationArray&& aAnimationValues,
|
||||||
const MutexAutoLock& aProofOfMapLock, const RefPtr<APZSampler>& aApzSampler,
|
const MutexAutoLock& aProofOfMapLock, const RefPtr<APZSampler>& aApzSampler,
|
||||||
AnimatedValue* aAnimatedValueEntry,
|
AnimatedValue* aAnimatedValueEntry,
|
||||||
JankedAnimationMap& aJankedAnimationMap) {
|
JankedAnimationMap& aJankedAnimationMap) {
|
||||||
@@ -311,7 +311,7 @@ bool CompositorAnimationStorage::SampleAnimations(
|
|||||||
const nsCSSPropertyID lastPropertyAnimationGroupProperty =
|
const nsCSSPropertyID lastPropertyAnimationGroupProperty =
|
||||||
animationStorageData->mAnimation.LastElement().mProperty;
|
animationStorageData->mAnimation.LastElement().mProperty;
|
||||||
isAnimating = true;
|
isAnimating = true;
|
||||||
AutoTArray<RefPtr<StyleAnimationValue>, 1> animationValues;
|
SampledAnimationArray animationValues;
|
||||||
AnimatedValue* previousValue = GetAnimatedValue(iter.first);
|
AnimatedValue* previousValue = GetAnimatedValue(iter.first);
|
||||||
AnimationHelper::SampleResult sampleResult =
|
AnimationHelper::SampleResult sampleResult =
|
||||||
AnimationHelper::SampleAnimationForEachNode(
|
AnimationHelper::SampleAnimationForEachNode(
|
||||||
@@ -364,7 +364,7 @@ bool CompositorAnimationStorage::SampleAnimations(
|
|||||||
// For the 2nd case, we store the base styles until we have some other
|
// For the 2nd case, we store the base styles until we have some other
|
||||||
// new sampled results or the new animations arrived (i.e. case 1).
|
// new sampled results or the new animations arrived (i.e. case 1).
|
||||||
StoreAnimatedValue(lastPropertyAnimationGroupProperty, iter.first,
|
StoreAnimatedValue(lastPropertyAnimationGroupProperty, iter.first,
|
||||||
animationStorageData, animationValues,
|
animationStorageData, std::move(animationValues),
|
||||||
aProofOfMapLock, apzSampler, previousValue,
|
aProofOfMapLock, apzSampler, previousValue,
|
||||||
janked);
|
janked);
|
||||||
}
|
}
|
||||||
@@ -373,8 +373,8 @@ bool CompositorAnimationStorage::SampleAnimations(
|
|||||||
|
|
||||||
// Store the normal sampled result.
|
// Store the normal sampled result.
|
||||||
StoreAnimatedValue(lastPropertyAnimationGroupProperty, iter.first,
|
StoreAnimatedValue(lastPropertyAnimationGroupProperty, iter.first,
|
||||||
animationStorageData, animationValues, aProofOfMapLock,
|
animationStorageData, std::move(animationValues),
|
||||||
apzSampler, previousValue, janked);
|
aProofOfMapLock, apzSampler, previousValue, janked);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ class Animation;
|
|||||||
class CompositorBridgeParent;
|
class CompositorBridgeParent;
|
||||||
class OMTAController;
|
class OMTAController;
|
||||||
|
|
||||||
typedef nsTArray<layers::Animation> AnimationArray;
|
using AnimationArray = nsTArray<layers::Animation>;
|
||||||
|
using SampledAnimationArray = AutoTArray<RefPtr<StyleAnimationValue>, 1>;
|
||||||
|
|
||||||
struct AnimationTransform {
|
struct AnimationTransform {
|
||||||
/*
|
/*
|
||||||
@@ -193,7 +194,7 @@ class CompositorAnimationStorage final {
|
|||||||
void StoreAnimatedValue(
|
void StoreAnimatedValue(
|
||||||
nsCSSPropertyID aProperty, uint64_t aId,
|
nsCSSPropertyID aProperty, uint64_t aId,
|
||||||
const std::unique_ptr<AnimationStorageData>& aAnimationStorageData,
|
const std::unique_ptr<AnimationStorageData>& aAnimationStorageData,
|
||||||
const AutoTArray<RefPtr<StyleAnimationValue>, 1>& aAnimationValues,
|
SampledAnimationArray&& aAnimationValues,
|
||||||
const MutexAutoLock& aProofOfMapLock,
|
const MutexAutoLock& aProofOfMapLock,
|
||||||
const RefPtr<APZSampler>& aApzSampler, AnimatedValue* aAnimatedValueEntry,
|
const RefPtr<APZSampler>& aApzSampler, AnimatedValue* aAnimatedValueEntry,
|
||||||
JankedAnimationMap& aJankedAnimationMap);
|
JankedAnimationMap& aJankedAnimationMap);
|
||||||
|
|||||||
Reference in New Issue
Block a user