Bug 1588224. Blob: Remove unused members and some debugging code.
authorJeff Muizelaar <jrmuizel@gmail.com>
Fri, 11 Oct 2019 21:59:59 +0000
changeset 497325 dfbe8f0a9dec8fe20bbeeb767bfa47fa40808c50
parent 497324 686a306609ad01ed4749b40d97a2b5116055ef4e
child 497326 d7e83d739e267950277d621e71b1736c390a8569
push id36682
push userncsoregi@mozilla.com
push dateSat, 12 Oct 2019 09:52:03 +0000
treeherdermozilla-central@06ea2371f897 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1588224
milestone71.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 1588224. Blob: Remove unused members and some debugging code. This also reduces the size of BlobItemData which will give us some free performance on SVGs that have a lot of items by reducing our working set size. Differential Revision: https://phabricator.services.mozilla.com/D49023
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -81,43 +81,37 @@ struct BlobItemData {
   IntRect mRect;
   // It would be nice to not need this. We need to be able to call
   // ComputeInvalidationRegion. ComputeInvalidationRegion will sometimes reach
   // into parent style structs to get information that can change the
   // invalidation region
   UniquePtr<nsDisplayItemGeometry> mGeometry;
   DisplayItemClip mClip;
   bool mUsed;  // initialized near construction
+  // XXX: only used for debugging
+  bool mInvalid;
 
   // a weak pointer to the group that owns this item
   // we use this to track whether group for a particular item has changed
   struct DIGroup* mGroup;
 
-  // XXX: only used for debugging
-  bool mInvalid;
-  bool mInvalidRegion;
-  bool mEmpty;
-
   // properties that are used to emulate layer tree invalidation
   Matrix mMatrix;  // updated to track the current transform to device space
   RefPtr<BasicLayerManager> mLayerManager;
 
   // We need to keep a list of all the external surfaces used by the blob image.
   // We do this on a per-display item basis so that the lists remains correct
   // during invalidations.
   std::vector<RefPtr<SourceSurface>> mExternalSurfaces;
 
   IntRect mImageRect;
-  LayerIntPoint mGroupOffset;
 
   BlobItemData(DIGroup* aGroup, nsDisplayItem* aItem)
       : mUsed(false), mGroup(aGroup) {
     mInvalid = false;
-    mInvalidRegion = false;
-    mEmpty = false;
     mDisplayItemKey = aItem->GetPerFrameKey();
     AddFrame(aItem->Frame());
   }
 
  private:
   void AddFrame(nsIFrame* aFrame) {
     mFrame = aFrame;
 
@@ -379,17 +373,16 @@ struct DIGroup {
     GP("clippedImageRect %d %d %d %d\n", mClippedImageBounds.x,
        mClippedImageBounds.y, mClippedImageBounds.width,
        mClippedImageBounds.height);
     LayerIntSize size = mVisibleRect.Size();
     GP("imageSize: %d %d\n", size.width, size.height);
     /*if (aItem->IsReused() && aData->mGeometry) {
       return;
     }*/
-    aData->mInvalidRegion = false;
 
     GP("pre mInvalidRect: %s %p-%d - inv: %d %d %d %d\n", aItem->Name(),
        aItem->Frame(), aItem->GetPerFrameKey(), mInvalidRect.x, mInvalidRect.y,
        mInvalidRect.width, mInvalidRect.height);
     if (!aData->mGeometry) {
       // This item is being added for the first time, invalidate its entire
       // area.
       UniquePtr<nsDisplayItemGeometry> geometry(
@@ -454,17 +447,16 @@ struct DIGroup {
         nsRect clippedBounds = clip.ApplyNonRoundedIntersection(
             aData->mGeometry->ComputeInvalidationRegion());
         IntRect transformedRect =
             ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel);
         aData->mRect = transformedRect.Intersect(mClippedImageBounds);
         InvalidateRect(aData->mRect);
 
         aData->mInvalid = true;
-        aData->mInvalidRegion = true;
       } else {
         if (aData->mClip != clip) {
           UniquePtr<nsDisplayItemGeometry> geometry(
               aItem->AllocateGeometry(aBuilder));
           if (!IsContainerLayerItem(aItem)) {
             // the bounds of layer items can change on us without
             // ComputeInvalidationRegion returning any change. Other items
             // shouldn't have any hidden geometry change.
@@ -788,32 +780,17 @@ struct DIGroup {
 
       bool dirty = true;
       auto preservedBounds = bounds.Intersect(mPreservedRect);
       if (!mInvalidRect.Contains(preservedBounds)) {
         GP("Passing\n");
         dirty = false;
         BlobItemData* data = GetBlobItemData(item);
         if (data->mInvalid) {
-          if (item->GetType() == DisplayItemType::TYPE_TRANSFORM) {
-            nsDisplayTransform* transformItem =
-                static_cast<nsDisplayTransform*>(item);
-            const Matrix4x4Flagged& t = transformItem->GetTransform();
-            Matrix t2d;
-            bool is2D = t.Is2D(&t2d);
-            gfxCriticalError()
-                << "DIT-" << is2D << "-r-" << data->mInvalidRegion << "-"
-                << bounds.x << "-" << bounds.y << "-" << bounds.width << "-"
-                << bounds.height << "," << mInvalidRect.x << "-"
-                << mInvalidRect.y << "-" << mInvalidRect.width << "-"
-                << mInvalidRect.height << "-sbi";
-          } else {
-            gfxCriticalError() << "DisplayItem" << item->Name() << "-region-"
-                               << data->mInvalidRegion << "-should be invalid";
-          }
+          gfxCriticalError() << "DisplayItem" << item->Name() << "-should be invalid";
         }
         // if the item is invalid it needs to be fully contained
         MOZ_RELEASE_ASSERT(!data->mInvalid);
       }
 
       nsDisplayList* children = item->GetChildren();
       if (children) {
         GP("doing children in EndGroup\n");