Bug 781516 - Remove DisplayItemDataEntry.mIsMergedFrame. r=roc
authorChris Lord <chrislord.net@gmail.com>
Fri, 24 Aug 2012 11:59:37 +0100
changeset 105320 a485ff9049542ead6fb380e3e8f047d7e05eec7b
parent 105319 5f8728a398a91ca95c9746e03ad293a5e0c48961
child 105321 fe4538ef86c5eb28a9c950419b32bd0548c82578
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersroc
bugs781516
milestone17.0a1
Bug 781516 - Remove DisplayItemDataEntry.mIsMergedFrame. r=roc This is unnecessary as it just duplicates the functionality of mIsSharingContainerLayer.
layout/base/FrameLayerBuilder.cpp
layout/base/FrameLayerBuilder.h
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -806,17 +806,17 @@ FrameLayerBuilder::UpdateDisplayItemData
                                                  void* aUserArg)
 {
   FrameLayerBuilder* builder = static_cast<FrameLayerBuilder*>(aUserArg);
   nsIFrame* f = aEntry->GetKey();
   FrameProperties props = f->Properties();
   DisplayItemDataEntry* newDisplayItems =
     builder ? builder->mNewDisplayItemData.GetEntry(f) : nullptr;
   if (!newDisplayItems || (newDisplayItems->mData.IsEmpty() &&
-                           !newDisplayItems->mIsMergedFrame)) {
+                           !newDisplayItems->mIsSharingContainerLayer)) {
     // This frame was visible, but isn't anymore.
     if (newDisplayItems) {
       builder->mNewDisplayItemData.RawRemoveEntry(newDisplayItems);
     }
     bool found;
     props.Remove(LayerManagerDataProperty(), &found);
     NS_ASSERTION(found, "How can the frame property be missing?");
     SetNoContainerLayer(f);
@@ -825,17 +825,16 @@ FrameLayerBuilder::UpdateDisplayItemData
 
   if (!newDisplayItems->HasNonEmptyContainerLayer()) {
     SetNoContainerLayer(f);
   }
 
   // Steal the list of display item layers and invalid region
   aEntry->mData.SwapElements(newDisplayItems->mData);
   aEntry->mInvalidRegion.swap(newDisplayItems->mInvalidRegion);
-  aEntry->mIsMergedFrame = newDisplayItems->mIsMergedFrame;
   // Clear and reset the invalid region now so we can start collecting new
   // dirty areas.
   SetAndClearInvalidRegion(aEntry);
   // Don't need to process this frame again
   builder->mNewDisplayItemData.RawRemoveEntry(newDisplayItems);
   return PL_DHASH_NEXT;
 }
 
@@ -854,17 +853,16 @@ FrameLayerBuilder::StoreNewDisplayItemDa
   // Remember that this frame has display items in retained layers
   NS_ASSERTION(!data->mFramesWithLayers.GetEntry(f),
                "We shouldn't get here if we're already in mFramesWithLayers");
   DisplayItemDataEntry *newEntry = data->mFramesWithLayers.PutEntry(f);
   NS_ASSERTION(!props.Get(LayerManagerDataProperty()),
                "mFramesWithLayers out of sync");
 
   newEntry->mData.SwapElements(aEntry->mData);
-  newEntry->mIsMergedFrame = aEntry->mIsMergedFrame;
   props.Set(LayerManagerDataProperty(), data);
   return PL_DHASH_REMOVE;
 }
 
 bool
 FrameLayerBuilder::HasRetainedLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKey)
 {
   nsTArray<DisplayItemData> *array = GetDisplayItemDataArrayForFrame(aFrame);
@@ -2384,20 +2382,16 @@ FrameLayerBuilder::BuildContainerLayerFo
           // Ensure that UpdateDisplayItemDataForFrame recognizes that we
           // still have a container layer associated with this frame.
           entry->mIsSharingContainerLayer = true;
 
           // Store the invalid region property in case this frame is represented
           // by multiple container layers. This is cleared and set when iterating
           // over the DisplayItemDataEntry's in WillEndTransaction.
           entry->mInvalidRegion = thebesLayerInvalidRegion;
-
-          // Mark that this is a merged frame so that we retain the display
-          // item data when updating.
-          entry->mIsMergedFrame = true;
         }
         ApplyThebesLayerInvalidation(aBuilder, mergedFrame, nullptr, state,
                                      &currentOffset, transformItem);
         SetHasContainerLayer(mergedFrame, currentOffset);
       }
     }
 
     Clip clip;
--- a/layout/base/FrameLayerBuilder.h
+++ b/layout/base/FrameLayerBuilder.h
@@ -466,37 +466,34 @@ protected:
    * the paint process, and store them in the frame property only when
    * paint is complete. This is the hashentry for that hashtable.
    */
   class DisplayItemDataEntry : public nsPtrHashKey<nsIFrame> {
   public:
     DisplayItemDataEntry(const nsIFrame *key)
       : nsPtrHashKey<nsIFrame>(key)
       , mIsSharingContainerLayer(false)
-      , mIsMergedFrame(false)
       {}
     DisplayItemDataEntry(DisplayItemDataEntry &toCopy)
       : nsPtrHashKey<nsIFrame>(toCopy.mKey)
       , mIsSharingContainerLayer(toCopy.mIsSharingContainerLayer)
     {
       // This isn't actually a copy-constructor; notice that it steals toCopy's
       // array and invalid region.  Be careful.
       mData.SwapElements(toCopy.mData);
       mInvalidRegion.swap(toCopy.mInvalidRegion);
       mContainerLayerGeneration = toCopy.mContainerLayerGeneration;
-      mIsMergedFrame = toCopy.mIsMergedFrame;
     }
 
     bool HasNonEmptyContainerLayer();
 
     nsAutoTArray<DisplayItemData, 1> mData;
     nsRefPtr<RefCountedRegion> mInvalidRegion;
     uint32_t mContainerLayerGeneration;
     bool mIsSharingContainerLayer;
-    bool mIsMergedFrame;
 
     enum { ALLOW_MEMMOVE = false };
   };
 
   // LayerManagerData needs to see DisplayItemDataEntry.
   friend class LayerManagerData;
 
   // Flash the area within the context clip if paint flashing is enabled.