Bug 1509575 - Expose the isFirstPaint flag on LayerManager. r=kats
☠☠ backed out by c908cdfffe30 ☠ ☠
authorBotond Ballo <botond@mozilla.com>
Fri, 11 Jan 2019 04:21:20 +0000
changeset 510545 7dcfa876f76cd181cb7f8d482770c09b32f6a849
parent 510544 9afb01b30049bad89a837b6889da359df70a2a61
child 510546 245d6855cd3bcb4ff5afd2ab9cc90ce2cedf8a00
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1509575
milestone66.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 1509575 - Expose the isFirstPaint flag on LayerManager. r=kats So that it's easily available during painting. The flag is set based on nsIPresShell::mIsFirstPaint, but the pres shell flag is cleared at the beginning of the paint, so we can't query it from the pres shell during the paint. Differential Revision: https://phabricator.services.mozilla.com/D16237
gfx/layers/Layers.h
gfx/layers/client/ClientLayerManager.h
gfx/layers/ipc/ShadowLayers.h
gfx/layers/wr/WebRenderLayerManager.h
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -605,16 +605,17 @@ class LayerManager : public FrameRecorde
    * is null.  |aSubtree|'s manager must be this.
    */
   virtual void ClearCachedResources(Layer* aSubtree = nullptr) {}
 
   /**
    * Flag the next paint as the first for a document.
    */
   virtual void SetIsFirstPaint() {}
+  virtual bool GetIsFirstPaint() const { return false; }
 
   /**
    * Set the current focus target to be sent with the next paint.
    */
   virtual void SetFocusTarget(const FocusTarget& aFocusTarget) {}
 
   /**
    * Make sure that the previous transaction has been entirely
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -129,16 +129,19 @@ class ClientLayerManager final : public 
   bool HasShadowManager() const { return mForwarder->HasShadowManager(); }
 
   virtual bool IsCompositingCheap() override;
   virtual bool HasShadowManagerInternal() const override {
     return HasShadowManager();
   }
 
   virtual void SetIsFirstPaint() override;
+  virtual bool GetIsFirstPaint() const override {
+    return mForwarder->GetIsFirstPaint();
+  }
 
   virtual void SetFocusTarget(const FocusTarget& aFocusTarget) override;
 
   /**
    * Pass through call to the forwarder for nsPresContext's
    * CollectPluginGeometryUpdates. Passes widget configuration information
    * to the compositor for transmission to the chrome process. This
    * configuration gets set when the window paints.
--- a/gfx/layers/ipc/ShadowLayers.h
+++ b/gfx/layers/ipc/ShadowLayers.h
@@ -333,16 +333,17 @@ class ShadowLayerForwarder final : publi
    * LayerManagerComposite.
    */
   LayerHandle ConstructShadowFor(ShadowableLayer* aLayer);
 
   /**
    * Flag the next paint as the first for a document.
    */
   void SetIsFirstPaint() { mIsFirstPaint = true; }
+  bool GetIsFirstPaint() const { return mIsFirstPaint; }
 
   /**
    * Set the current focus target to be sent with the next paint.
    */
   void SetFocusTarget(const FocusTarget& aFocusTarget) {
     mFocusTarget = aFocusTarget;
   }
 
--- a/gfx/layers/wr/WebRenderLayerManager.h
+++ b/gfx/layers/wr/WebRenderLayerManager.h
@@ -134,16 +134,17 @@ class WebRenderLayerManager final : publ
 
   virtual void ScheduleComposite() override;
 
   virtual void SetNeedsComposite(bool aNeedsComposite) override {
     mNeedsComposite = aNeedsComposite;
   }
   virtual bool NeedsComposite() const override { return mNeedsComposite; }
   virtual void SetIsFirstPaint() override { mIsFirstPaint = true; }
+  virtual bool GetIsFirstPaint() const override { return mIsFirstPaint; }
   virtual void SetFocusTarget(const FocusTarget& aFocusTarget) override;
 
   virtual already_AddRefed<PersistentBufferProvider>
   CreatePersistentBufferProvider(const gfx::IntSize& aSize,
                                  gfx::SurfaceFormat aFormat) override;
 
   bool AsyncPanZoomEnabled() const override;