Bug 1379628 - Ensure pixels for Android dynamic toolbar snapshot get processed even if the toolbar is not visible so pending animations may run r=kats draft
authorRandall Barker <rbarker@mozilla.com>
Wed, 12 Jul 2017 12:54:59 -0700
changeset 607743 2069d1720a985245e1dae87248632352495e75eb
parent 607742 63215af4995f74aae2a6b24ad148e83d47c732f9
child 637133 33ce81216c2415cc949c2d760e8b1b890342d902
push id68095
push userbmo:rbarker@mozilla.com
push dateWed, 12 Jul 2017 20:01:47 +0000
reviewerskats
bugs1379628
milestone56.0a1
Bug 1379628 - Ensure pixels for Android dynamic toolbar snapshot get processed even if the toolbar is not visible so pending animations may run r=kats MozReview-Commit-ID: 9iMFN2gdfKl
gfx/layers/composite/LayerManagerComposite.cpp
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -1184,23 +1184,24 @@ LayerManagerComposite::RenderToolbar()
   if (mCompositor->GetTargetContext() != nullptr) {
     return;
   }
 
   if (CompositorBridgeParent* bridge = mCompositor->GetCompositorBridgeParent()) {
     AndroidDynamicToolbarAnimator* animator = bridge->GetAPZCTreeManager()->GetAndroidDynamicToolbarAnimator();
     MOZ_RELEASE_ASSERT(animator);
 
+    EffectChain effects;
+    effects.mPrimaryEffect = animator->GetToolbarEffect(mCompositor->AsCompositorOGL());
+
     int32_t toolbarHeight = animator->GetCurrentToolbarHeight();
     if (toolbarHeight == 0) {
       return;
     }
 
-    EffectChain effects;
-    effects.mPrimaryEffect = animator->GetToolbarEffect(mCompositor->AsCompositorOGL());
     // If GetToolbarEffect returns null, nothing is rendered for the static snapshot of the toolbar.
     // If the real toolbar chrome is not covering this portion of the surface, the clear color
     // of the surface will be visible. On Android the clear color is the background color of the page.
     if (effects.mPrimaryEffect) {
       ScopedCompositorRenderOffset toolbarOffset(mCompositor->AsCompositorOGL(),
                                                  ScreenPoint(0.0f, -animator->GetCurrentContentOffset()));
       mCompositor->DrawQuad(gfx::Rect(0, 0, mRenderBounds.width, toolbarHeight),
                             IntRect(0, 0, mRenderBounds.width, toolbarHeight), effects, 1.0, gfx::Matrix4x4());