Bug 1358437 - Setup correct opacity/transform in stacking context when there exists opacity/transform aniamtions. r?kats
Pass empty opacity(transform) in stacking context when there exists opacity(transform) animations and
the final opacity(transform) value will be resolved on the compositor after animation sampling
MozReview-Commit-ID: 6pF9Oe8Ks2I
--- a/gfx/layers/wr/WebRenderContainerLayer.cpp
+++ b/gfx/layers/wr/WebRenderContainerLayer.cpp
@@ -52,20 +52,27 @@ WebRenderContainerLayer::RenderLayer(wr:
float opacity = GetLocalOpacity();
float* maybeOpacity = &opacity;
uint64_t animationsId = 0;
if (gfxPrefs::WebRenderOMTAEnabled() &&
!GetAnimations().IsEmpty()) {
MOZ_ASSERT(GetCompositorAnimationsId());
- if (!HasOpacityAnimation()) {
+ // Update opacity as nullptr in stacking context if there exists
+ // opacity animation, the opacity value will be resolved
+ // after animation sampling on the compositor
+ if (HasOpacityAnimation()) {
maybeOpacity = nullptr;
}
- if (!HasTransformAnimation()) {
+
+ // Update transfrom as nullptr in stacking context if there exists
+ // transform animation, the transform value will be resolved
+ // after animation sampling on the compositor
+ if (HasTransformAnimation()) {
maybeTransform = nullptr;
UpdateTransformDataForAnimation();
}
animationsId = GetCompositorAnimationsId();
CompositorAnimations anim;
anim.animations() = GetAnimations();
anim.id() = animationsId;