mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Backed out 2 changesets (bug 1456679) for Reftests failure. CLOSED TREE
Backed out changeset c40209504a45 (bug 1456679) Backed out changeset 351ae90cc6a0 (bug 1456679)
This commit is contained in:
parent
1c84618b5b
commit
5846115845
@ -546,16 +546,15 @@ AnimationHelper::GetNextCompositorAnimationsId()
|
||||
return nextId;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
|
||||
TimeStamp aTime)
|
||||
{
|
||||
MOZ_ASSERT(aStorage);
|
||||
bool isAnimating = false;
|
||||
|
||||
// Do nothing if there are no compositor animations
|
||||
if (!aStorage->AnimationsCount()) {
|
||||
return isAnimating;
|
||||
return;
|
||||
}
|
||||
|
||||
//Sample the animations in CompositorAnimationStorage
|
||||
@ -566,7 +565,6 @@ AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
|
||||
continue;
|
||||
}
|
||||
|
||||
isAnimating = true;
|
||||
RefPtr<RawServoAnimationValue> animationValue;
|
||||
InfallibleTArray<AnimData> animationData;
|
||||
AnimationHelper::SetAnimations(*animations,
|
||||
@ -628,8 +626,6 @@ AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
|
||||
MOZ_ASSERT_UNREACHABLE("Unhandled animated property");
|
||||
}
|
||||
}
|
||||
|
||||
return isAnimating;
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
@ -248,13 +248,8 @@ public:
|
||||
* Sample animation based a given time stamp |aTime| and the animation
|
||||
* data inside CompositorAnimationStorage |aStorage|. The animated values
|
||||
* after sampling will be stored in CompositorAnimationStorage as well.
|
||||
*
|
||||
* Returns true if there is any animation.
|
||||
* Note that even if there are only in-delay phase animations (i.e. not
|
||||
* visually effective), this function returns true to ensure we composite
|
||||
* again on the next tick.
|
||||
*/
|
||||
static bool
|
||||
static void
|
||||
SampleAnimations(CompositorAnimationStorage* aStorage,
|
||||
TimeStamp aTime);
|
||||
};
|
||||
|
@ -53,6 +53,8 @@ struct OpAddExternalImage {
|
||||
|
||||
struct OpAddCompositorAnimations {
|
||||
CompositorAnimations data;
|
||||
OptionalTransform transform;
|
||||
OptionalOpacity opacity;
|
||||
};
|
||||
|
||||
struct OpAddPipelineIdForCompositable {
|
||||
|
@ -776,6 +776,15 @@ WebRenderBridgeParent::ProcessWebRenderParentCommands(const InfallibleTArray<Web
|
||||
if (data.animations().Length()) {
|
||||
mAnimStorage->SetAnimations(data.id(), data.animations());
|
||||
mActiveAnimations.insert(data.id());
|
||||
// Store the default opacity
|
||||
if (op.opacity().type() == OptionalOpacity::Tfloat) {
|
||||
mAnimStorage->SetAnimatedValue(data.id(), op.opacity().get_float());
|
||||
}
|
||||
// Store the default transform
|
||||
if (op.transform().type() == OptionalTransform::TMatrix4x4) {
|
||||
Matrix4x4 transform(Move(op.transform().get_Matrix4x4()));
|
||||
mAnimStorage->SetAnimatedValue(data.id(), Move(transform));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1167,7 +1176,7 @@ WebRenderBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
WebRenderBridgeParent::AdvanceAnimations()
|
||||
{
|
||||
if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) {
|
||||
@ -1178,15 +1187,15 @@ WebRenderBridgeParent::AdvanceAnimations()
|
||||
// refresh mode, on the testing mode animations on the compositor are
|
||||
// synchronously composed, so we don't need to worry about the time gap
|
||||
// between the main thread and compositor thread.
|
||||
return AnimationHelper::SampleAnimations(mAnimStorage, *testingTimeStamp);
|
||||
AnimationHelper::SampleAnimations(mAnimStorage, *testingTimeStamp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
TimeStamp lastComposeTime = mCompositorScheduler->GetLastComposeTime();
|
||||
// if we have already mPreviousTimeStamp, use it since on the compositor the
|
||||
// time in the previous tick is more closer to the main-thread tick time.
|
||||
const bool isAnimating =
|
||||
AnimationHelper::SampleAnimations(mAnimStorage,
|
||||
AnimationHelper::SampleAnimations(mAnimStorage,
|
||||
!mPreviousFrameTimeStamp.IsNull()
|
||||
? mPreviousFrameTimeStamp
|
||||
: lastComposeTime);
|
||||
@ -1196,15 +1205,13 @@ WebRenderBridgeParent::AdvanceAnimations()
|
||||
// started animations.
|
||||
mPreviousFrameTimeStamp =
|
||||
mAnimStorage->AnimatedValueCount() ? lastComposeTime : TimeStamp();
|
||||
|
||||
return isAnimating;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
WebRenderBridgeParent::SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
|
||||
nsTArray<wr::WrTransformProperty>& aTransformArray)
|
||||
{
|
||||
const bool isAnimating = AdvanceAnimations();
|
||||
AdvanceAnimations();
|
||||
|
||||
// return the animated data if has
|
||||
if (mAnimStorage->AnimatedValueCount()) {
|
||||
@ -1220,8 +1227,6 @@ WebRenderBridgeParent::SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isAnimating;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1268,7 +1273,8 @@ WebRenderBridgeParent::CompositeToTarget(gfx::DrawTarget* aTarget, const gfx::In
|
||||
nsTArray<wr::WrOpacityProperty> opacityArray;
|
||||
nsTArray<wr::WrTransformProperty> transformArray;
|
||||
|
||||
if (SampleAnimations(opacityArray, transformArray)) {
|
||||
SampleAnimations(opacityArray, transformArray);
|
||||
if (!transformArray.IsEmpty() || !opacityArray.IsEmpty()) {
|
||||
ScheduleGenerateFrame();
|
||||
}
|
||||
// We do this even if the arrays are empty, because it will clear out any
|
||||
|
@ -214,10 +214,8 @@ private:
|
||||
bool ShouldParentObserveEpoch();
|
||||
mozilla::ipc::IPCResult HandleShutdown();
|
||||
|
||||
// Returns true if there is any animation (including animations in delay
|
||||
// phase).
|
||||
bool AdvanceAnimations();
|
||||
bool SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
|
||||
void AdvanceAnimations();
|
||||
void SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
|
||||
nsTArray<wr::WrTransformProperty>& aTransformArray);
|
||||
|
||||
CompositorBridgeParent* GetRootCompositorBridgeParent() const;
|
||||
|
@ -6701,12 +6701,14 @@ nsDisplayOpacity::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuil
|
||||
|
||||
if (!animationInfo.GetAnimations().IsEmpty()) {
|
||||
opacityForSC = nullptr;
|
||||
OptionalOpacity opacityForCompositor = mOpacity;
|
||||
prop.id = animationsId;
|
||||
prop.effect_type = wr::WrAnimationType::Opacity;
|
||||
|
||||
|
||||
OpAddCompositorAnimations
|
||||
anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId));
|
||||
anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId),
|
||||
void_t(), opacityForCompositor);
|
||||
aManager->WrBridge()->AddWebRenderParentCommand(anim);
|
||||
aManager->AddActiveCompositorAnimationId(animationsId);
|
||||
} else if (animationsId) {
|
||||
@ -8552,8 +8554,13 @@ nsDisplayTransform::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBu
|
||||
prop.id = animationsId;
|
||||
prop.effect_type = wr::WrAnimationType::Transform;
|
||||
|
||||
// Pass default transform to compositor in case gecko fails to
|
||||
// get animated value after animation sampling.
|
||||
OptionalTransform transformForCompositor = newTransformMatrix;
|
||||
|
||||
OpAddCompositorAnimations
|
||||
anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId));
|
||||
anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId),
|
||||
transformForCompositor, void_t());
|
||||
aManager->WrBridge()->AddWebRenderParentCommand(anim);
|
||||
aManager->AddActiveCompositorAnimationId(animationsId);
|
||||
} else if (animationsId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user