Bug 1532568 - Don't pass the display item types to FrameLayerBuilder::EnumerateGenerationForDedicatedLayers; r=hiro
authorBrian Birtles <birtles@gmail.com>
Thu, 07 Mar 2019 05:40:24 +0000
changeset 520705 47dfb7c2aa932121e3eb769c87f7d206ab059437
parent 520704 f8b979bd590424560bf17a1877baa575b29b6013
child 520706 1d56a0d3a3236253b297d9928083175c2d1b403e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1532568
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 1532568 - Don't pass the display item types to FrameLayerBuilder::EnumerateGenerationForDedicatedLayers; r=hiro We always pass the same set of types so it seems simpler to just look it up within the function itself. Differential Revision: https://phabricator.services.mozilla.com/D22444
gfx/layers/AnimationInfo.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/FrameLayerBuilder.h
--- a/gfx/layers/AnimationInfo.cpp
+++ b/gfx/layers/AnimationInfo.cpp
@@ -216,14 +216,13 @@ void AnimationInfo::EnumerateGenerationO
       if (animationData) {
         generation = animationData->GetAnimationInfo().GetAnimationGeneration();
       }
       aCallback(generation, displayItem);
     }
     return;
   }
 
-  FrameLayerBuilder::EnumerateGenerationForDedicatedLayers(
-      aFrame, LayerAnimationInfo::sDisplayItemTypes, aCallback);
+  FrameLayerBuilder::EnumerateGenerationForDedicatedLayers(aFrame, aCallback);
 }
 
 }  // namespace layers
 }  // namespace mozilla
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -6418,25 +6418,23 @@ Layer* FrameLayerBuilder::GetDedicatedLa
       }
     }
   }
   return nullptr;
 }
 
 /* static */
 void FrameLayerBuilder::EnumerateGenerationForDedicatedLayers(
-    const nsIFrame* aFrame,
-    const CompositorAnimatableDisplayItemTypes& aDisplayItemTypes,
-    const AnimationGenerationCallback& aCallback) {
+    const nsIFrame* aFrame, const AnimationGenerationCallback& aCallback) {
   std::bitset<static_cast<uint32_t>(DisplayItemType::TYPE_MAX)> notFoundTypes;
-  for (auto displayItemType : aDisplayItemTypes) {
+  for (auto displayItemType : LayerAnimationInfo::sDisplayItemTypes) {
     notFoundTypes.set(static_cast<uint32_t>(displayItemType));
   }
 
-  for (auto displayItemType : aDisplayItemTypes) {
+  for (auto displayItemType : LayerAnimationInfo::sDisplayItemTypes) {
     // For transform animations, the animation is on the primary frame but
     // |aFrame| is the style frame.
     const nsIFrame* frameToQuery =
         displayItemType == DisplayItemType::TYPE_TRANSFORM
             ? nsLayoutUtils::GetPrimaryFrameFromStyleFrame(aFrame)
             : aFrame;
     const nsIFrame::DisplayItemDataArray& displayItemDataArray =
         frameToQuery->DisplayItemData();
@@ -6476,17 +6474,17 @@ void FrameLayerBuilder::EnumerateGenerat
   // Bail out if we have already enumerated all possible layers for the given
   // display item types.
   if (notFoundTypes.none()) {
     return;
   }
 
   // If there are any display item types that the nsIFrame doesn't have, we need
   // to call the callback function for them respectively.
-  for (auto displayItemType : aDisplayItemTypes) {
+  for (auto displayItemType : LayerAnimationInfo::sDisplayItemTypes) {
     if (notFoundTypes[static_cast<uint32_t>(displayItemType)] &&
         !aCallback(Nothing(), displayItemType)) {
       return;
     }
   }
 }
 
 gfxSize FrameLayerBuilder::GetPaintedLayerScaleForFrame(nsIFrame* aFrame) {
--- a/layout/painting/FrameLayerBuilder.h
+++ b/layout/painting/FrameLayerBuilder.h
@@ -473,31 +473,29 @@ class FrameLayerBuilder : public layers:
   /**
    * Call this to determine if a frame has a dedicated (non-Painted) layer
    * for the given display item key. If there isn't one, we return null,
    * otherwise we return the layer.
    */
   static Layer* GetDedicatedLayer(nsIFrame* aFrame,
                                   DisplayItemType aDisplayItemType);
 
-  using CompositorAnimatableDisplayItemTypes =
-      Array<DisplayItemType, nsCSSPropertyIDSet::CompositorAnimatableCount()>;
   using AnimationGenerationCallback = std::function<bool(
       const Maybe<uint64_t>& aGeneration, DisplayItemType aDisplayItemType)>;
   /**
-   * Enumerates layers for the given display item types and calls |aCallback|
+   * Enumerates layers for the all display item types that correspond to
+   * properties we can animate on layers and calls |aCallback|
    * with the animation generation for the layer.  If there is no corresponding
    * layer for the display item or the layer has no animation, the animation
    * generation is Nothing().
    *
    * The enumeration stops if |aCallback| returns false.
    */
   static void EnumerateGenerationForDedicatedLayers(
       const nsIFrame* aFrame,
-      const CompositorAnimatableDisplayItemTypes& aDisplayItemTypes,
       const AnimationGenerationCallback& aCallback);
 
   /**
    * This callback must be provided to EndTransaction. The callback data
    * must be the nsDisplayListBuilder containing this FrameLayerBuilder.
    * This function can be called multiple times in a row to draw
    * different regions. This will occur when, for example, progressive paint is
    * enabled. In these cases aDirtyRegion can be used to specify a larger region