Bug 1549576 - Store fixed layer margin in session and send to compositor when ready. r=geckoview-reviewers,snorp
☠☠ backed out by 1a5f757dd6f9 ☠ ☠
authorEitan Isaacson <eitan@monotonous.org>
Tue, 07 May 2019 17:54:22 +0000
changeset 534821 45f82a11656c33e633132d8c4d54841e42cc97dc
parent 534820 72723e7257b1f9825a5f1a6478c0dbdea9202c97
child 534822 fbdbe72f12e42fc3937c89768f24a50ff709f1c2
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp
bugs1549576
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549576 - Store fixed layer margin in session and send to compositor when ready. r=geckoview-reviewers,snorp Differential Revision: https://phabricator.services.mozilla.com/D30132
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
@@ -114,17 +114,17 @@ public class GeckoDisplay {
      *
      * @param clippingHeight The height of the bottom clipped space in screen pixels.
      */
     @UiThread
     public void setVerticalClipping(final int clippingHeight) {
         ThreadUtils.assertOnUiThread();
 
         if (mSession != null) {
-            mSession.mCompositor.setFixedBottomOffset(clippingHeight);
+            mSession.setFixedBottomOffset(clippingHeight);
         }
     }
 
     /**
      * Return whether the display should be pinned on the screen.
      *
      * When pinned, the display should not be moved on the screen due to animation, scrolling, etc.
      * A common reason for the display being pinned is when the user is dragging a selection caret
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -128,16 +128,17 @@ public class GeckoSession implements Par
     private int mLeft;
     private int mTop; // Top of the surface (including toolbar);
     private int mClientTop; // Top of the client area (i.e. excluding toolbar);
     private int mOffsetX;
     private int mOffsetY;
     private int mWidth;
     private int mHeight; // Height of the surface (including toolbar);
     private int mClientHeight; // Height of the client area (i.e. excluding toolbar);
+    private int mFixedBottomOffset; // The margin for fixed elements attached to the bottom of the viewport.
     private float mViewportLeft;
     private float mViewportTop;
     private float mViewportZoom = 1.0f;
 
     //
     // NOTE: These values are also defined in
     // gfx/layers/ipc/UiCompositorControllerMessageTypes.h and must be kept in sync. Any
     // new AnimatorMessageType added here must also be added there.
@@ -4745,16 +4746,25 @@ public class GeckoSession implements Par
             return;
         }
 
         mLeft = left;
         mTop = top;
         onWindowBoundsChanged();
     }
 
+    /* package */ void setFixedBottomOffset(int offset) {
+        mFixedBottomOffset = offset;
+
+        if (mCompositorReady) {
+            mCompositor.setFixedBottomOffset(mFixedBottomOffset);
+        }
+    }
+
+
     /* package */ void onCompositorAttached() {
         if (DEBUG) {
             ThreadUtils.assertOnUiThread();
         }
 
         mAttachedCompositor = true;
         mCompositor.attachNPZC(mPanZoomController.mNative);
 
@@ -4865,16 +4875,18 @@ public class GeckoSession implements Par
             // compositor now that the compositor is ready.
             onSurfaceChanged(mSurface, mOffsetX, mOffsetY, mWidth, mHeight);
             mSurface = null;
         }
 
         if (mToolbar != null) {
             mToolbar.onCompositorReady();
         }
+
+        mCompositor.setFixedBottomOffset(mFixedBottomOffset);
     }
 
     /* package */ void updateOverscrollVelocity(final float x, final float y) {
         if (DEBUG) {
             ThreadUtils.assertOnUiThread();
         }
 
         if (mOverscroll == null) {