Bug 622542. Remove unused FrameLayerBuilder::InvalidateAllThebesLayerContents API. r=tnikkel a2.0=blocking
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 10 Feb 2011 15:21:07 -0800
changeset 62315 3268bdbd64c4edc0d86e2cab9511713f83046b09
parent 62314 502b2bea2c4de2b2a7d96ae40c18c38ccbb44fe0
child 62316 0a3f2dd6870f9f4803c9a9c74313eaf700a8bc10
push idunknown
push userunknown
push dateunknown
reviewerstnikkel
bugs622542
milestone2.0b12pre
Bug 622542. Remove unused FrameLayerBuilder::InvalidateAllThebesLayerContents API. r=tnikkel a2.0=blocking
layout/base/FrameLayerBuilder.cpp
layout/base/FrameLayerBuilder.h
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -59,17 +59,16 @@ namespace mozilla {
 namespace {
 
 /**
  * This is the userdata we associate with a layer manager.
  */
 class LayerManagerData : public LayerUserData {
 public:
   LayerManagerData(LayerManager *aManager) :
-    mInvalidateAllThebesContent(PR_FALSE),
     mInvalidateAllLayers(PR_FALSE),
     mLayerManager(aManager)
   {
     MOZ_COUNT_CTOR(LayerManagerData);
     mFramesWithLayers.Init();
   }
   ~LayerManagerData() {
     // Remove display item data properties now, since we won't be able
@@ -78,17 +77,16 @@ public:
         FrameLayerBuilder::RemoveDisplayItemDataForFrame, nsnull);
     MOZ_COUNT_DTOR(LayerManagerData);
   }
 
   /**
    * Tracks which frames have layers associated with them.
    */
   nsTHashtable<nsPtrHashKey<nsIFrame> > mFramesWithLayers;
-  PRPackedBool mInvalidateAllThebesContent;
   PRPackedBool mInvalidateAllLayers;
   /** Layer manager we belong to, we hold a reference to this object. */
   nsRefPtr<LayerManager> mLayerManager;
 };
 
 static void DestroyRegion(void* aPropertyValue)
 {
   delete static_cast<nsRegion*>(aPropertyValue);
@@ -463,17 +461,16 @@ FrameLayerBuilder::DestroyDisplayItemDat
 
 void
 FrameLayerBuilder::DidBeginRetainedLayerTransaction(LayerManager* aManager)
 {
   mRetainingManager = aManager;
   LayerManagerData* data = static_cast<LayerManagerData*>
     (aManager->GetUserData(&gLayerManagerUserData));
   if (data) {
-    mInvalidateAllThebesContent = data->mInvalidateAllThebesContent;
     mInvalidateAllLayers = data->mInvalidateAllLayers;
   }
 }
 
 /**
  * A helper function to remove the mThebesLayerItems entries for every
  * layer in aLayer's subtree.
  */
@@ -522,17 +519,16 @@ FrameLayerBuilder::WillEndTransaction(La
   } else {
     data = new LayerManagerData(mRetainingManager);
     mRetainingManager->SetUserData(&gLayerManagerUserData, data);
   }
   // Now go through all the frames that didn't have any retained
   // display items before, and record those retained display items.
   // This also empties mNewDisplayItemData.
   mNewDisplayItemData.EnumerateEntries(StoreNewDisplayItemData, data);
-  data->mInvalidateAllThebesContent = PR_FALSE;
   data->mInvalidateAllLayers = PR_FALSE;
 
   NS_ASSERTION(data->mFramesWithLayers.Count() > 0,
                "Some frame must have a layer!");
 }
 
 /* static */ PLDHashOperator
 FrameLayerBuilder::UpdateDisplayItemDataForFrame(nsPtrHashKey<nsIFrame>* aEntry,
@@ -758,18 +754,17 @@ ContainerState::CreateOrRecycleThebesLay
     // scroll position as of the most recent paint.
     if (mInvalidateAllThebesContent) {
       nsIntRect invalidate = layer->GetValidRegion().GetBounds();
       layer->InvalidateRegion(invalidate);
     } else {
       InvalidatePostTransformRegion(layer, mInvalidThebesContent);
     }
     // We do not need to Invalidate these areas in the widget because we
-    // assume the caller of InvalidateThebesLayerContents or
-    // InvalidateAllThebesLayerContents has ensured
+    // assume the caller of InvalidateThebesLayerContents has ensured
     // the area is invalidated in the widget.
   } else {
     // Create a new thebes layer
     layer = mManager->CreateThebesLayer();
     if (!layer)
       return nsnull;
     // Mark this layer as being used for Thebes-painting display items
     layer->SetUserData(&gThebesDisplayItemLayerUserData,
@@ -1552,20 +1547,16 @@ FrameLayerBuilder::BuildContainerLayerFo
 
   if (aManager == mRetainingManager) {
     DisplayItemDataEntry* entry = mNewDisplayItemData.PutEntry(aContainerFrame);
     if (entry) {
       entry->mData.AppendElement(
           DisplayItemData(containerLayer, containerDisplayItemKey));
     }
 
-    if (mInvalidateAllThebesContent) {
-      state.SetInvalidateAllThebesContent();
-    }
-
     nsRegion* invalidThebesContent(static_cast<nsRegion*>
       (props.Get(ThebesLayerInvalidRegionProperty())));
     if (invalidThebesContent) {
       nsPoint offset = aBuilder->ToReferenceFrame(aContainerFrame);
       invalidThebesContent->MoveBy(offset);
       state.SetInvalidThebesContent(invalidThebesContent->
         ToOutsidePixels(aContainerFrame->PresContext()->AppUnitsPerDevPixel()));
       // We have to preserve the current contents of invalidThebesContent
@@ -1680,26 +1671,16 @@ InternalInvalidateThebesLayersInSubtree(
 
 /* static */ void
 FrameLayerBuilder::InvalidateThebesLayersInSubtree(nsIFrame* aFrame)
 {
   InternalInvalidateThebesLayersInSubtree(aFrame);
 }
 
 /* static */ void
-FrameLayerBuilder::InvalidateAllThebesLayerContents(LayerManager* aManager)
-{
-  LayerManagerData* data = static_cast<LayerManagerData*>
-    (aManager->GetUserData(&gLayerManagerUserData));
-  if (data) {
-    data->mInvalidateAllThebesContent = PR_TRUE;
-  }
-}
-
-/* static */ void
 FrameLayerBuilder::InvalidateAllLayers(LayerManager* aManager)
 {
   LayerManagerData* data = static_cast<LayerManagerData*>
     (aManager->GetUserData(&gLayerManagerUserData));
   if (data) {
     data->mInvalidateAllLayers = PR_TRUE;
   }
 }
--- a/layout/base/FrameLayerBuilder.h
+++ b/layout/base/FrameLayerBuilder.h
@@ -94,17 +94,16 @@ public:
   typedef layers::ContainerLayer ContainerLayer; 
   typedef layers::Layer Layer; 
   typedef layers::ThebesLayer ThebesLayer;
   typedef layers::LayerManager LayerManager;
 
   FrameLayerBuilder() :
     mRetainingManager(nsnull),
     mDetectedDOMModification(PR_FALSE),
-    mInvalidateAllThebesContent(PR_FALSE),
     mInvalidateAllLayers(PR_FALSE)
   {
     mNewDisplayItemData.Init();
     mThebesLayerItems.Init();
   }
 
   void Init(nsDisplayListBuilder* aBuilder);
 
@@ -177,22 +176,16 @@ public:
    * For any descendant frame of aFrame (including across documents) that
    * has an associated container layer, invalidate all the contents of
    * all ThebesLayer children of the container. Useful when aFrame is
    * being moved and we need to invalidate everything in aFrame's subtree.
    */
   static void InvalidateThebesLayersInSubtree(nsIFrame* aFrame);
 
   /**
-   * Call this to force *all* retained layer contents to be discarded at
-   * the next paint.
-   */
-  static void InvalidateAllThebesLayerContents(LayerManager* aManager);
-
-  /**
    * Call this to force all retained layers to be discarded and recreated at
    * the next paint.
    */
   static void InvalidateAllLayers(LayerManager* aManager);
 
   /**
    * Call this to determine if a frame has a dedicated (non-Thebes) layer
    * for the given display item key.
@@ -490,21 +483,16 @@ protected:
    */
   PRUint32                            mInitialDOMGeneration;
   /**
    * Set to true if we have detected and reported DOM modification during
    * the current paint.
    */
   PRPackedBool                        mDetectedDOMModification;
   /**
-   * Indicates that the contents of all ThebesLayers should be rerendered
-   * during this paint.
-   */
-  PRPackedBool                        mInvalidateAllThebesContent;
-  /**
    * Indicates that the entire layer tree should be rerendered
    * during this paint.
    */
   PRPackedBool                        mInvalidateAllLayers;
 };
 
 }