Bug 1438551 - Remove unused mPaintedRegion from TiledLayerBuffer. r?nical draft
authorRyan Hunt <rhunt@eqrion.net>
Thu, 12 Apr 2018 15:40:21 -0500
changeset 781719 f45a716061c5e10750e52417e63522a12cc42242
parent 781718 ac150fad072c10bc832b84dfb5ebb9b91f515170
push id106388
push userbmo:rhunt@eqrion.net
push dateFri, 13 Apr 2018 14:19:25 +0000
reviewersnical
bugs1438551
milestone61.0a1
Bug 1438551 - Remove unused mPaintedRegion from TiledLayerBuffer. r?nical This appears to be unused, and is just needlessly calculating something. MozReview-Commit-ID: Jpm9sBwJBfT
gfx/layers/TiledLayerBuffer.h
gfx/layers/client/SingleTiledContentClient.cpp
gfx/layers/client/SingleTiledContentClient.h
gfx/layers/client/TiledContentClient.h
--- a/gfx/layers/TiledLayerBuffer.h
+++ b/gfx/layers/TiledLayerBuffer.h
@@ -157,34 +157,31 @@ public:
 
   gfx::IntSize GetScaledTileSize() const { return gfx::IntSize::Round(gfx::Size(mTileSize) / mResolution); }
 
   unsigned int GetTileCount() const { return mRetainedTiles.Length(); }
 
   Tile& GetTile(size_t i) { return mRetainedTiles[i]; }
 
   const nsIntRegion& GetValidRegion() const { return mValidRegion; }
-  const nsIntRegion& GetPaintedRegion() const { return mPaintedRegion; }
-  void ClearPaintedRegion() { mPaintedRegion.SetEmpty(); }
 
   // Get and set draw scaling. mResolution affects the resolution at which the
   // contents of the buffer are drawn. mResolution has no effect on the
   // coordinate space of the valid region, but does affect the size of an
   // individual tile's rect in relation to the valid region.
   // Setting the resolution will invalidate the buffer.
   float GetResolution() const { return mResolution; }
   bool IsLowPrecision() const { return mResolution < 1; }
 
   void Dump(std::stringstream& aStream, const char* aPrefix, bool aDumpHtml,
             TextureDumpMode aCompress);
 
 protected:
 
   nsIntRegion     mValidRegion;
-  nsIntRegion     mPaintedRegion;
 
   /**
    * mRetainedTiles is a rectangular buffer of mTiles.mSize.width x mTiles.mSize.height
    * stored as column major with the same origin as mValidRegion.GetBounds().
    * Any tile that does not intersect mValidRegion is a PlaceholderTile.
    * Only the region intersecting with mValidRegion should be read from a tile,
    * another other region is assumed to be uninitialized. The contents of the
    * tiles is scaled by mResolution.
--- a/gfx/layers/client/SingleTiledContentClient.cpp
+++ b/gfx/layers/client/SingleTiledContentClient.cpp
@@ -28,17 +28,16 @@ SingleTiledContentClient::ClearCachedRes
   CompositableClient::ClearCachedResources();
   mTiledBuffer->DiscardBuffers();
 }
 
 void
 SingleTiledContentClient::UpdatedBuffer(TiledBufferType aType)
 {
   mForwarder->UseTiledLayerBuffer(this, mTiledBuffer->GetSurfaceDescriptorTiles());
-  mTiledBuffer->ClearPaintedRegion();
 }
 
 /* static */ bool
 SingleTiledContentClient::ClientSupportsLayerSize(const gfx::IntSize& aSize, ClientLayerManager* aManager)
 {
   int32_t maxTextureSize = aManager->GetMaxTextureSize();
   return aSize.width <= maxTextureSize && aSize.height <= maxTextureSize;
 }
@@ -175,18 +174,16 @@ ClientSingleTiledLayerBuffer::PaintThebe
   tileDirtyRegion.OrWith(tileInvalidRegion);
 
   // Mark the region we will be painting and the region we copied from the front buffer as
   // needing to be uploaded to the compositor
   mTile.mUpdateRect = tileDirtyRegion.GetBounds().Union(extraPainted.GetBounds());
 
   extraPainted.MoveBy(mTilingOrigin);
   extraPainted.And(extraPainted, aNewValidRegion);
-  mPaintedRegion.OrWith(paintRegion);
-  mPaintedRegion.OrWith(extraPainted);
 
   if (!backBuffer) {
     return;
   }
 
   RefPtr<gfx::DrawTarget> dt = backBuffer->BorrowDrawTarget();
   RefPtr<gfx::DrawTarget> dtOnWhite;
   if (backBufferOnWhite) {
--- a/gfx/layers/client/SingleTiledContentClient.h
+++ b/gfx/layers/client/SingleTiledContentClient.h
@@ -54,17 +54,16 @@ public:
                          LayerManager::DrawPaintedLayerCallback aCallback,
                          void* aCallbackData) override
   {
     MOZ_ASSERT(false, "ProgressiveUpdate not supported!");
     return false;
   }
 
   void ResetPaintedAndValidState() override {
-    mPaintedRegion.SetEmpty();
     mValidRegion.SetEmpty();
     mTile.DiscardBuffers();
   }
 
   const nsIntRegion& GetValidRegion() override {
     return mValidRegion;
   }
 
@@ -73,26 +72,21 @@ public:
   }
 
   void ReleaseTiles();
 
   void DiscardBuffers();
 
   SurfaceDescriptorTiles GetSurfaceDescriptorTiles();
 
-  void ClearPaintedRegion() {
-    mPaintedRegion.SetEmpty();
-  }
-
 private:
   TileClient mTile;
 
   RefPtr<ClientLayerManager> mManager;
 
-  nsIntRegion mPaintedRegion;
   nsIntRegion mValidRegion;
   bool mWasLastPaintProgressive;
 
   /**
    * While we're adding tiles, this is used to keep track of the position of
    * the top-left of the top-left-most tile.  When we come to wrap the tiles in
    * TiledDrawTarget we subtract the value of this member from each tile's
    * offset so that all the tiles have a positive offset, then add a
--- a/gfx/layers/client/TiledContentClient.h
+++ b/gfx/layers/client/TiledContentClient.h
@@ -379,17 +379,16 @@ public:
                          const nsIntRegion& aInvalidRegion,
                          const nsIntRegion& aOldValidRegion,
                          nsIntRegion& aOutDrawnRegion,
                          BasicTiledLayerPaintData* aPaintData,
                          LayerManager::DrawPaintedLayerCallback aCallback,
                          void* aCallbackData) override;
   
   void ResetPaintedAndValidState() override {
-    mPaintedRegion.SetEmpty();
     mValidRegion.SetEmpty();
     mTiles.mSize.width = 0;
     mTiles.mSize.height = 0;
     DiscardBuffers();
     mRetainedTiles.Clear();
   }