Bug 1358437 - Setup correct opacity/transform in stacking context when there exists opacity/transform aniamtions. r?kats draft
authorpeter chang <pchang@mozilla.com>
Fri, 28 Apr 2017 16:01:00 +0800
changeset 570180 6e49bcb1e885b0eb6c03179ab53ac4b1359bea5f
parent 570179 80ed5dd93c302d9d0cdc44b3b52cf15763f4740f
child 570181 5b604860e0d32009d88290222db18b1b294e675b
push id56417
push userbmo:howareyou322@gmail.com
push dateFri, 28 Apr 2017 13:34:36 +0000
reviewerskats
bugs1358437
milestone55.0a1
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
gfx/layers/wr/WebRenderContainerLayer.cpp
--- 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;