Bug 1459312 - Have AlignFixedAndStickyLayers take the ClipPartsCache by reference rather than pointer. r=kats
authorBotond Ballo <botond@mozilla.com>
Sat, 02 Feb 2019 23:53:27 +0000
changeset 456569 949c039c7de914e6c22dc778d901696dd472c31b
parent 456568 016c3e822444aa9aa678a57cfc3c4a646859a091
child 456570 5deb799c5ba37db4fffbffb9bcd1964ef89c72d6
push id35490
push useraiakab@mozilla.com
push dateSun, 03 Feb 2019 09:50:26 +0000
treeherdermozilla-central@12b2328eedd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1459312
milestone67.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 1459312 - Have AlignFixedAndStickyLayers take the ClipPartsCache by reference rather than pointer. r=kats This reflects the fact that it's no longer optional (the code path that wouldn't pass one was removed with JPZC). Differential Revision: https://phabricator.services.mozilla.com/D17722
gfx/layers/composite/AsyncCompositionManager.cpp
gfx/layers/composite/AsyncCompositionManager.h
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -395,17 +395,17 @@ static Maybe<ScrollableLayerGuid::ViewID
   return Nothing();
 }
 
 void AsyncCompositionManager::AlignFixedAndStickyLayers(
     Layer* aTransformedSubtreeRoot, Layer* aStartTraversalAt,
     ScrollableLayerGuid::ViewID aTransformScrollId,
     const LayerToParentLayerMatrix4x4& aPreviousTransformForRoot,
     const LayerToParentLayerMatrix4x4& aCurrentTransformForRoot,
-    const ScreenMargin& aFixedLayerMargins, ClipPartsCache* aClipPartsCache) {
+    const ScreenMargin& aFixedLayerMargins, ClipPartsCache& aClipPartsCache) {
   Layer* layer = aStartTraversalAt;
   bool needsAsyncTransformUnapplied = false;
   if (Maybe<ScrollableLayerGuid::ViewID> fixedTo = IsFixedOrSticky(layer)) {
     needsAsyncTransformUnapplied = AsyncTransformShouldBeUnapplied(
         layer, *fixedTo, aTransformedSubtreeRoot, aTransformScrollId);
   }
 
   // We want to process all the fixed and sticky descendants of
@@ -524,17 +524,17 @@ void AsyncCompositionManager::AlignFixed
   // where the async transform on |aTransformedSubtreeRoot| affects this layer's
   // clip rect, we need to apply the same translation to said clip rect, so
   // that the effective transform on the clip rect takes it back to where it was
   // originally, had there been no async scroll.
   TranslateShadowLayer(
       layer,
       ViewAs<ParentLayerPixel>(translation,
                                PixelCastJustification::NoTransformOnLayer),
-      true, aClipPartsCache);
+      true, &aClipPartsCache);
 
   // Propragate the unconsumed portion of the translation to descendant
   // fixed/sticky layers.
   if (unconsumedTranslation != LayerPoint()) {
     // Take the computations we performed to derive |translation| from
     // |aCurrentTransformForRoot|, and perform them in reverse, keeping other
     // quantities fixed, to come up with a new transform |newTransform| that
     // would produce |unconsumedTranslation|.
@@ -1114,17 +1114,17 @@ bool AsyncCompositionManager::ApplyAsync
                 sampler->GetCurrentAsyncTransformForFixedAdjustment(wrapper);
             LayerToParentLayerMatrix4x4 transformWithoutOverscrollOrOmta =
                 layer->GetTransformTyped() *
                 CompleteAsyncTransform(
                     AdjustForClip(asyncTransformForFixedAdjustment, layer));
             AlignFixedAndStickyLayers(layer, layer, metrics.GetScrollId(),
                                       oldTransform,
                                       transformWithoutOverscrollOrOmta,
-                                      fixedLayerMargins, &clipPartsCache);
+                                      fixedLayerMargins, clipPartsCache);
 
             // Combine the local clip with the ancestor scrollframe clip. This
             // is not included in the async transform above, since the ancestor
             // clip should not move with this APZC.
             if (scrollMetadata.HasScrollClip()) {
               ParentLayerIntRect clip =
                   scrollMetadata.ScrollClip().GetClipRect();
               if (layer->GetParent() &&
--- a/gfx/layers/composite/AsyncCompositionManager.h
+++ b/gfx/layers/composite/AsyncCompositionManager.h
@@ -151,28 +151,28 @@ class AsyncCompositionManager final {
    * overscroll-related transform, which we don't want to adjust for.
    * For sticky position layers, the translation is further intersected with
    * the layer's sticky scroll ranges.
    * This function will also adjust layers so that the given content document
    * fixed position margins will be respected during asynchronous panning and
    * zooming.
    * |aTransformScrollId| is the scroll id of the scroll frame that scrolls
    * |aTransformedSubtreeRoot|.
-   * |aClipPartsCache| optionally maps layers to separate fixed and scrolled
+   * |aClipPartsCache| maps layers to separate fixed and scrolled
    * clips, so we can only adjust the fixed portion.
    * This function has a recursive implementation; aStartTraversalAt specifies
    * where to start the current recursion of the traversal. For the initial
    * call, it should be the same as aTrasnformedSubtreeRoot.
    */
   void AlignFixedAndStickyLayers(
       Layer* aTransformedSubtreeRoot, Layer* aStartTraversalAt,
       ScrollableLayerGuid::ViewID aTransformScrollId,
       const LayerToParentLayerMatrix4x4& aPreviousTransformForRoot,
       const LayerToParentLayerMatrix4x4& aCurrentTransformForRoot,
-      const ScreenMargin& aFixedLayerMargins, ClipPartsCache* aClipPartsCache);
+      const ScreenMargin& aFixedLayerMargins, ClipPartsCache& aClipPartsCache);
 
   /**
    * DRAWING PHASE ONLY
    *
    * For reach RefLayer in our layer tree, look up its referent and connect it
    * to the layer tree, if found.
    * aHasRemoteContent - indicates if the layer tree contains a remote reflayer.
    *  May be null.