Backed out changeset 9db369ba372c (bug 1375759) for unused mComputedDrawRegion. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 27 Jun 2017 20:47:30 +0200
changeset 366161 7da6c99070996a8d0baa4013d4c0b515f8045fa2
parent 366160 d516c35eabf14738e03728f9be602b732e63078c
child 366162 37e047b6187f8a2cc9ce30268d42977e679db84e
push id91903
push userarchaeopteryx@coole-files.de
push dateTue, 27 Jun 2017 18:47:41 +0000
treeherdermozilla-inbound@7da6c9907099 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1375759
milestone56.0a1
backs out9db369ba372ccc31274de3ecd6598e6a16ca1995
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
Backed out changeset 9db369ba372c (bug 1375759) for unused mComputedDrawRegion. r=backout
gfx/layers/Layers.cpp
gfx/layers/Layers.h
gfx/layers/mlgpu/ContainerLayerMLGPU.cpp
gfx/layers/mlgpu/ContainerLayerMLGPU.h
gfx/layers/mlgpu/LayerMLGPU.cpp
gfx/layers/mlgpu/LayerMLGPU.h
gfx/layers/mlgpu/LayerManagerMLGPU.cpp
gfx/layers/mlgpu/LayerManagerMLGPU.h
gfx/layers/mlgpu/PaintedLayerMLGPU.h
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -2098,25 +2098,16 @@ Layer::IsBackfaceHidden()
 UniquePtr<LayerUserData>
 Layer::RemoveUserData(void* aKey)
 {
   UniquePtr<LayerUserData> d(static_cast<LayerUserData*>(mUserData.Remove(static_cast<gfx::UserDataKey*>(aKey))));
   return d;
 }
 
 void
-Layer::SetManager(LayerManager* aManager, HostLayer* aSelf)
-{
-  // No one should be calling this for weird reasons.
-  MOZ_ASSERT(aSelf);
-  MOZ_ASSERT(aSelf->GetLayer() == this);
-  mManager = aManager;
-}
-
-void
 PaintedLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
 {
   Layer::PrintInfo(aStream, aPrefix);
   nsIntRegion validRegion = GetValidRegion();
   if (!validRegion.IsEmpty()) {
     AppendToString(aStream, validRegion, " [valid=", "]");
   }
 }
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -839,21 +839,16 @@ public:
 
   /**
    * Returns the LayerManager this Layer belongs to. Note that the layer
    * manager might be in a destroyed state, at which point it's only
    * valid to set/get user data from it.
    */
   LayerManager* Manager() { return mManager; }
 
-  /**
-   * This should only be called when changing layer managers from HostLayers.
-   */
-  void SetManager(LayerManager* aManager, HostLayer* aSelf);
-
   enum {
     /**
      * If this is set, the caller is promising that by the end of this
      * transaction the entire visible region (as specified by
      * SetVisibleRegion) will be filled with opaque content.
      */
     CONTENT_OPAQUE = 0x01,
     /**
--- a/gfx/layers/mlgpu/ContainerLayerMLGPU.cpp
+++ b/gfx/layers/mlgpu/ContainerLayerMLGPU.cpp
@@ -44,22 +44,16 @@ ContainerLayerMLGPU::OnPrepareToRender(F
     mInvalidRect = viewport;
   } else {
     // Clamp the invalid rect to the viewport.
     mInvalidRect = mInvalidRect.Intersect(viewport);
   }
   return true;
 }
 
-void
-ContainerLayerMLGPU::OnLayerManagerChange(LayerManagerMLGPU* aManager)
-{
-  ClearCachedResources();
-}
-
 RefPtr<MLGRenderTarget>
 ContainerLayerMLGPU::UpdateRenderTarget(MLGDevice* aDevice, MLGRenderTargetFlags aFlags)
 {
   if (mRenderTarget) {
     return mRenderTarget;
   }
 
   mRenderTarget = aDevice->CreateRenderTarget(mTargetSize, aFlags);
--- a/gfx/layers/mlgpu/ContainerLayerMLGPU.h
+++ b/gfx/layers/mlgpu/ContainerLayerMLGPU.h
@@ -48,17 +48,16 @@ public:
   }
   void ClearInvalidRect() {
     mInvalidRect.SetEmpty();
   }
   bool IsContentOpaque() override;
 
 protected:
   bool OnPrepareToRender(FrameBuilder* aBuilder) override;
-  void OnLayerManagerChange(LayerManagerMLGPU* aManager) override;
 
 private:
   RefPtr<MLGRenderTarget> mRenderTarget;
 
   // We cache these since occlusion culling can change the visible region.
   gfx::IntPoint mTargetOffset;
   gfx::IntSize mTargetSize;
 
--- a/gfx/layers/mlgpu/LayerMLGPU.cpp
+++ b/gfx/layers/mlgpu/LayerMLGPU.cpp
@@ -120,32 +120,16 @@ LayerMLGPU::IsContentOpaque()
 }
 
 void
 LayerMLGPU::SetRegionToRender(LayerIntRegion&& aRegion)
 {
   SetShadowVisibleRegion(Move(aRegion));
 }
 
-void
-LayerMLGPU::SetLayerManager(HostLayerManager* aManager)
-{
-  LayerManagerMLGPU* manager = aManager->AsLayerManagerMLGPU();
-  MOZ_RELEASE_ASSERT(manager);
-
-  HostLayer::SetLayerManager(aManager);
-  GetLayer()->SetManager(manager, this);
-
-  if (CompositableHost* host = GetCompositableHost()) {
-    host->SetTextureSourceProvider(manager->GetTextureSourceProvider());
-  }
-
-  OnLayerManagerChange(manager);
-}
-
 RefLayerMLGPU::RefLayerMLGPU(LayerManagerMLGPU* aManager)
   : RefLayer(aManager, static_cast<HostLayer*>(this))
   , LayerMLGPU(aManager)
 {
 }
 
 RefLayerMLGPU::~RefLayerMLGPU()
 {
--- a/gfx/layers/mlgpu/LayerMLGPU.h
+++ b/gfx/layers/mlgpu/LayerMLGPU.h
@@ -100,21 +100,16 @@ protected:
   LayerManagerMLGPU* GetManager();
 
   void AddBoundsToView(FrameBuilder* aBuilder,
                        RenderViewMLGPU* aView,
                        Maybe<gfx::Polygon>&& aGeometry);
 
   void MarkPrepared();
 
-  // We don't want derivative layers overriding this directly - we provide a
-  // callback instead.
-  void SetLayerManager(HostLayerManager* aManager) override;
-  virtual void OnLayerManagerChange(LayerManagerMLGPU* aManager) {}
-
 private:
   // This is a monotonic counter used to check whether a layer appears twice
   // when 3d sorting.
   static uint64_t sFrameKey;
 
 protected:
   // These are set during PrepareToRender.
   RenderTargetIntRect mComputedClipRect;
--- a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp
+++ b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp
@@ -188,22 +188,16 @@ LayerManagerMLGPU::GetTextureFactoryIden
 }
 
 LayersBackend
 LayerManagerMLGPU::GetBackendType()
 {
   return mDevice ? mDevice->GetLayersBackend() : LayersBackend::LAYERS_NONE;
 }
 
-void
-LayerManagerMLGPU::SetRoot(Layer* aLayer)
-{
-  mRoot = aLayer;
-}
-
 bool
 LayerManagerMLGPU::BeginTransaction()
 {
   MOZ_ASSERT(!mTarget);
   return true;
 }
 
 void
--- a/gfx/layers/mlgpu/LayerManagerMLGPU.h
+++ b/gfx/layers/mlgpu/LayerManagerMLGPU.h
@@ -33,17 +33,17 @@ public:
   ~LayerManagerMLGPU();
 
   bool Initialize();
   void Destroy() override;
 
   // LayerManager methods
   bool BeginTransaction() override;
   void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget, const gfx::IntRect& aRect) override;
-  void SetRoot(Layer* aLayer) override;
+  void SetRoot(Layer* aLayer) override { mRoot = aLayer; }
   already_AddRefed<PaintedLayer> CreatePaintedLayer() override;
   already_AddRefed<ContainerLayer> CreateContainerLayer() override;
   already_AddRefed<ImageLayer> CreateImageLayer() override;
   already_AddRefed<ColorLayer> CreateColorLayer() override;
   already_AddRefed<TextLayer> CreateTextLayer() override;
   already_AddRefed<CanvasLayer> CreateCanvasLayer() override;
   already_AddRefed<RefLayer> CreateRefLayer() override;
   already_AddRefed<BorderLayer> CreateBorderLayer() override;
--- a/gfx/layers/mlgpu/PaintedLayerMLGPU.h
+++ b/gfx/layers/mlgpu/PaintedLayerMLGPU.h
@@ -59,16 +59,17 @@ public:
 
   MOZ_LAYER_DECL_NAME("PaintedLayerMLGPU", TYPE_PAINTED)
 
   void CleanupCachedResources();
 
 protected:
   void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
   bool OnPrepareToRender(FrameBuilder* aBuilder) override;
+  void ComputeDrawRegion();
 
   void CleanupResources();
 
 private:
   RefPtr<ContentHostTexture> mHost;
   RefPtr<TextureSource> mTexture;
   RefPtr<TextureSource> mTextureOnWhite;
   gfx::IntRegion mLocalDrawRegion;