Backing out bug 615870 34bd12eb4a9c for causing bug 618916, a=stuart
authorMichael Wu <mwu@mozilla.com>
Mon, 13 Dec 2010 16:15:16 -0800
changeset 59172 8ea5456c4349bbabdacd21e780167c9aabb38019
parent 59170 7cd5faf6f58c0c7891c9214369d97c70f25feb1f (current diff)
parent 59171 1b297eb0a27dfaa012ceb7cd6af8d24d98826db9 (diff)
child 59173 4dbbc3061278f1b877e26123148190e1599e0dce
push idunknown
push userunknown
push dateunknown
reviewersstuart
bugs615870, 618916
milestone2.0b8pre
Backing out bug 615870 34bd12eb4a9c for causing bug 618916, a=stuart
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -300,32 +300,20 @@ public:
                                            const nsIntRegion& aRegionToInvalidate,
                                            void* aCallbackData);
   /**
    * Finish the construction phase of the transaction, perform the
    * drawing phase, and end the transaction.
    * During the drawing phase, all ThebesLayers in the tree are
    * drawn in tree order, exactly once each, except for those layers
    * where it is known that the visible region is empty.
-   *
-   * If aCallback is null, this is a 'null' transaction.
-   * There must have been no updates to the layer tree in this transaction.
-   * A null transaction can fail, in which case EndTransaction returns false,
-   * and the transaction must be retried with aCallback set to something non-null.
-   *
-   * If IsNullTransactionSupported() returns false, then aCallback must be non-null.
    */
-  virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
+  virtual void EndTransaction(DrawThebesLayerCallback aCallback,
                               void* aCallbackData) = 0;
 
-  /**
-   * See EndTransaction description
-   */
-  virtual bool IsNullTransactionSupported() { return false; }
-
   PRBool IsSnappingEffectiveTransforms() { return mSnapEffectiveTransforms; } 
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the root layer.
    */
   virtual void SetRoot(Layer* aLayer) = 0;
   /**
--- a/gfx/layers/basic/BasicLayers.cpp
+++ b/gfx/layers/basic/BasicLayers.cpp
@@ -497,21 +497,16 @@ BasicThebesLayer::Paint(gfxContext* aCon
       (opacity == 1.0 && !canUseOpaqueSurface &&
        !ShouldRetainTransparentSurface(mContentFlags, targetSurface) &&
        !MustRetainContent())) {
     mValidRegion.SetEmpty();
     mBuffer.Clear();
 
     nsIntRegion toDraw = IntersectWithClip(mVisibleRegion, target);
     if (!toDraw.IsEmpty()) {
-      if (!aCallback) {
-        BasicManager()->SetTransactionIncomplete();
-        return;
-      }
-
       target->Save();
       gfxUtils::ClipToRegionSnapped(target, toDraw);
       if (opacity != 1.0) {
         target->PushGroup(contentType);
       }
       aCallback(this, target, toDraw, nsIntRegion(), aCallbackData);
       if (opacity != 1.0) {
         target->PopGroupToSource();
@@ -1015,17 +1010,16 @@ MayHaveOverlappingOrTransparentLayers(La
 BasicLayerManager::BasicLayerManager(nsIWidget* aWidget) :
 #ifdef DEBUG
   mPhase(PHASE_NONE),
 #endif
   mXResolution(1.0)
   , mYResolution(1.0)
   , mWidget(aWidget)
   , mDoubleBuffering(BUFFER_NONE), mUsingDefaultTarget(PR_FALSE)
-  , mTransactionIncomplete(false)
 {
   MOZ_COUNT_CTOR(BasicLayerManager);
   NS_ASSERTION(aWidget, "Must provide a widget");
 }
 
 BasicLayerManager::BasicLayerManager() :
 #ifdef DEBUG
   mPhase(PHASE_NONE),
@@ -1186,27 +1180,25 @@ MarkLeafLayersCoveredByOpaque(Layer* aLa
     }
   } else {
     for (; child; child = child->GetPrevSibling()) {
       MarkLeafLayersCoveredByOpaque(child, newClipRect, aRegion);
     }
   }
 }
 
-bool
+void
 BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
                                   void* aCallbackData)
 {
 #ifdef MOZ_LAYERS_HAVE_LOG
   MOZ_LAYERS_LOG(("  ----- (beginning paint)"));
   Log();
 #endif
 
-  mTransactionIncomplete = false;
-
   NS_ASSERTION(InConstruction(), "Should be in construction phase");
 #ifdef DEBUG
   mPhase = PHASE_DRAWING;
 #endif
 
   if (mTarget) {
     NS_ASSERTION(mRoot, "Root not set");
 
@@ -1229,22 +1221,16 @@ BasicLayerManager::EndTransaction(DrawTh
       !(mTarget->GetFlags() & gfxContext::FLAG_DISABLE_SNAPPING);
     mRoot->ComputeEffectiveTransforms(gfx3DMatrix::From2D(mTarget->CurrentMatrix()));
 
     nsIntRegion region;
     MarkLeafLayersCoveredByOpaque(mRoot,
                                   mRoot->GetEffectiveVisibleRegion().GetBounds(),
                                   region);
     PaintLayer(mRoot, aCallback, aCallbackData);
-    if (mTransactionIncomplete) {
-#ifdef DEBUG
-      mPhase = PHASE_NONE;
-#endif
-      return false;
-    }
 
     if (useDoubleBuffering) {
       finalTarget->SetOperator(gfxContext::OPERATOR_SOURCE);
       PopGroupWithCachedSurface(finalTarget, cachedSurfaceOffset);
     }
 
     mTarget = nsnull;
   }
@@ -1253,17 +1239,16 @@ BasicLayerManager::EndTransaction(DrawTh
   Log();
   MOZ_LAYERS_LOG(("]----- EndTransaction"));
 #endif
 
 #ifdef DEBUG
   mPhase = PHASE_NONE;
 #endif
   mUsingDefaultTarget = PR_FALSE;
-  return true;
 }
 
 void
 BasicLayerManager::SetRoot(Layer* aLayer)
 {
   NS_ASSERTION(aLayer, "Root can't be null");
   NS_ASSERTION(aLayer->Manager() == this, "Wrong manager");
   NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
@@ -1319,26 +1304,20 @@ BasicLayerManager::PaintLayer(Layer* aLa
   if (!child) {
     BasicImplData* data = ToData(aLayer);
 #ifdef MOZ_LAYERS_HAVE_LOG
     MOZ_LAYERS_LOG(("%s (0x%p) is covered: %i\n", __FUNCTION__,
                    (void*)aLayer, data->IsCoveredByOpaque()));
 #endif
     if (!data->IsCoveredByOpaque()) {
       data->Paint(mTarget, aCallback, aCallbackData);
-      if (mTransactionIncomplete) {
-        return;
-      }
     }
   } else {
     for (; child; child = child->GetNextSibling()) {
       PaintLayer(child, aCallback, aCallbackData);
-      if (mTransactionIncomplete) {
-        return;
-      }
     }
   }
 
   if (needsGroup) {
     mTarget->PopGroupToSource();
     // If the layer is opaque in its visible region we pushed a CONTENT_COLOR
     // group. We need to make sure that only pixels inside the layer's visible
     // region are copied back to the destination.
@@ -1653,21 +1632,16 @@ BasicShadowableThebesLayer::SetBackBuffe
 
 void
 BasicShadowableThebesLayer::PaintBuffer(gfxContext* aContext,
                                         const nsIntRegion& aRegionToDraw,
                                         const nsIntRegion& aRegionToInvalidate,
                                         LayerManager::DrawThebesLayerCallback aCallback,
                                         void* aCallbackData)
 {
-  if (!aCallback) {
-    BasicManager()->SetTransactionIncomplete();
-    mIsNewBuffer = false;
-    return;
-  }
   Base::PaintBuffer(aContext, aRegionToDraw, aRegionToInvalidate,
                     aCallback, aCallbackData);
   if (!HasShadow()) {
     return;
   }
 
   nsIntRegion updatedRegion;
   if (mIsNewBuffer) {
@@ -2552,31 +2526,21 @@ BasicShadowLayerManager::BeginTransactio
 {
   NS_ABORT_IF_FALSE(mKeepAlive.IsEmpty(), "uncommitted txn?");
   if (HasShadowManager()) {
     ShadowLayerForwarder::BeginTransaction();
   }
   BasicLayerManager::BeginTransactionWithTarget(aTarget);
 }
 
-bool
+void
 BasicShadowLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
                                         void* aCallbackData)
 {
-  if (!BasicLayerManager::EndTransaction(aCallback, aCallbackData)) {
-    NS_WARNING("Failed to finish transaction, clear mKeepAlive");
-    if (HasShadowManager())
-      ShadowLayerForwarder::EndTransaction(nsnull);
-    mKeepAlive.Clear();
-#ifdef DEBUG
-    mPhase = PHASE_NONE;
-#endif
-    return false;
-  }
-
+  BasicLayerManager::EndTransaction(aCallback, aCallbackData);
 #ifdef DEBUG
   mPhase = PHASE_FORWARD;
 #endif
 
   // forward this transaction's changeset to our ShadowLayerManager
   AutoInfallibleTArray<EditReply, 10> replies;
   if (HasShadowManager() && ShadowLayerForwarder::EndTransaction(&replies)) {
     for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
@@ -2623,17 +2587,16 @@ BasicShadowLayerManager::EndTransaction(
 
 #ifdef DEBUG
   mPhase = PHASE_NONE;
 #endif
 
   // this may result in Layers being deleted, which results in
   // PLayer::Send__delete__() and DeallocShmem()
   mKeepAlive.Clear();
-  return true;
 }
 
 ShadowableLayer*
 BasicShadowLayerManager::Hold(Layer* aLayer)
 {
   NS_ABORT_IF_FALSE(HasShadowManager(),
                     "top-level tree, no shadow tree to remote to");
 
--- a/gfx/layers/basic/BasicLayers.h
+++ b/gfx/layers/basic/BasicLayers.h
@@ -135,17 +135,17 @@ public:
   float XResolution() const { return mXResolution; }
   float YResolution() const { return mYResolution; }
 
   nsIWidget* GetRetainerWidget() { return mWidget; }
   void ClearRetainerWidget() { mWidget = nsnull; }
 
   virtual void BeginTransaction();
   virtual void BeginTransactionWithTarget(gfxContext* aTarget);
-  virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
+  virtual void EndTransaction(DrawThebesLayerCallback aCallback,
                               void* aCallbackData);
 
   virtual void SetRoot(Layer* aLayer);
 
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
   virtual already_AddRefed<ImageLayer> CreateImageLayer();
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
@@ -176,20 +176,16 @@ public:
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   virtual const char* Name() const { return "Basic"; }
 #endif // MOZ_LAYERS_HAVE_LOG
 
   // Clear the cached contents of this layer.
   void ClearCachedResources();
 
-  bool IsNullTransactionSupported() { return mRoot ? true : false; }
-
-  void SetTransactionIncomplete() { mTransactionIncomplete = true; }
-
 protected:
 #ifdef DEBUG
   enum TransactionPhase {
     PHASE_NONE, PHASE_CONSTRUCTION, PHASE_DRAWING, PHASE_FORWARD
   };
   TransactionPhase mPhase;
 #endif
 
@@ -220,32 +216,31 @@ private:
   // The context to draw into.
   nsRefPtr<gfxContext> mTarget;
 
   // Cached surface for double buffering
   gfxCachedTempSurface mCachedSurface;
 
   BufferMode   mDoubleBuffering;
   PRPackedBool mUsingDefaultTarget;
-  bool mTransactionIncomplete;
 };
  
 
 #ifdef MOZ_IPC
 class BasicShadowLayerManager : public BasicLayerManager,
                                 public ShadowLayerForwarder
 {
   typedef nsTArray<nsRefPtr<Layer> > LayerRefArray;
 
 public:
   BasicShadowLayerManager(nsIWidget* aWidget);
   virtual ~BasicShadowLayerManager();
 
   virtual void BeginTransactionWithTarget(gfxContext* aTarget);
-  virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
+  virtual void EndTransaction(DrawThebesLayerCallback aCallback,
                               void* aCallbackData);
 
   virtual void SetRoot(Layer* aLayer);
 
   virtual void Mutated(Layer* aLayer);
 
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
--- a/gfx/layers/d3d10/LayerManagerD3D10.cpp
+++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp
@@ -225,32 +225,31 @@ LayerManagerD3D10::BeginTransaction()
 }
 
 void
 LayerManagerD3D10::BeginTransactionWithTarget(gfxContext* aTarget)
 {
   mTarget = aTarget;
 }
 
-bool
+void
 LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
                                   void* aCallbackData)
 {
   mCurrentCallbackInfo.Callback = aCallback;
   mCurrentCallbackInfo.CallbackData = aCallbackData;
 
   // The results of our drawing always go directly into a pixel buffer,
   // so we don't need to pass any global transform here.
   mRoot->ComputeEffectiveTransforms(gfx3DMatrix());
 
   Render();
   mCurrentCallbackInfo.Callback = nsnull;
   mCurrentCallbackInfo.CallbackData = nsnull;
   mTarget = nsnull;
-  return true;
 }
 
 already_AddRefed<ThebesLayer>
 LayerManagerD3D10::CreateThebesLayer()
 {
   nsRefPtr<ThebesLayer> layer = new ThebesLayerD3D10(this);
   return layer.forget();
 }
--- a/gfx/layers/d3d10/LayerManagerD3D10.h
+++ b/gfx/layers/d3d10/LayerManagerD3D10.h
@@ -99,17 +99,17 @@ public:
 
   void BeginTransactionWithTarget(gfxContext* aTarget);
 
   struct CallbackInfo {
     DrawThebesLayerCallback Callback;
     void *CallbackData;
   };
 
-  bool EndTransaction(DrawThebesLayerCallback aCallback,
+  void EndTransaction(DrawThebesLayerCallback aCallback,
                       void* aCallbackData);
 
   const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; }
 
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
 
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
 
--- a/gfx/layers/d3d9/LayerManagerD3D9.cpp
+++ b/gfx/layers/d3d9/LayerManagerD3D9.cpp
@@ -144,34 +144,33 @@ LayerManagerD3D9::BeginTransactionWithTa
   mTarget = aTarget;
 }
 
 void
 LayerManagerD3D9::EndConstruction()
 {
 }
 
-bool
+void
 LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback,
                                  void* aCallbackData)
 {
   mCurrentCallbackInfo.Callback = aCallback;
   mCurrentCallbackInfo.CallbackData = aCallbackData;
 
   // The results of our drawing always go directly into a pixel buffer,
   // so we don't need to pass any global transform here.
   mRoot->ComputeEffectiveTransforms(gfx3DMatrix());
 
   Render();
   /* Clean this out for sanity */
   mCurrentCallbackInfo.Callback = NULL;
   mCurrentCallbackInfo.CallbackData = NULL;
   // Clear mTarget, next transaction could have no target
   mTarget = NULL;
-  return true;
 }
 
 void
 LayerManagerD3D9::SetRoot(Layer *aLayer)
 {
   mRoot = aLayer;
 }
 
--- a/gfx/layers/d3d9/LayerManagerD3D9.h
+++ b/gfx/layers/d3d9/LayerManagerD3D9.h
@@ -127,17 +127,17 @@ public:
 
   void EndConstruction();
 
   struct CallbackInfo {
     DrawThebesLayerCallback Callback;
     void *CallbackData;
   };
 
-  bool EndTransaction(DrawThebesLayerCallback aCallback,
+  void EndTransaction(DrawThebesLayerCallback aCallback,
                       void* aCallbackData);
 
   const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; }
 
   void SetRoot(Layer* aLayer);
 
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
 
--- a/gfx/layers/opengl/LayerManagerOGL.cpp
+++ b/gfx/layers/opengl/LayerManagerOGL.cpp
@@ -387,28 +387,28 @@ LayerManagerOGL::BeginTransactionWithTar
   if (mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return;
   }
 
   mTarget = aTarget;
 }
 
-bool
+void
 LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
                                 void* aCallbackData)
 {
 #ifdef MOZ_LAYERS_HAVE_LOG
   MOZ_LAYERS_LOG(("  ----- (beginning paint)"));
   Log();
 #endif
 
   if (mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
-    return false;
+    return;
   }
 
   // The results of our drawing always go directly into a pixel buffer,
   // so we don't need to pass any global transform here.
   mRoot->ComputeEffectiveTransforms(gfx3DMatrix());
 
   mThebesLayerCallback = aCallback;
   mThebesLayerCallbackData = aCallbackData;
@@ -422,17 +422,16 @@ LayerManagerOGL::EndTransaction(DrawTheb
   mThebesLayerCallbackData = nsnull;
 
   mTarget = NULL;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   Log();
   MOZ_LAYERS_LOG(("]----- EndTransaction"));
 #endif
-  return true;
 }
 
 already_AddRefed<ThebesLayer>
 LayerManagerOGL::CreateThebesLayer()
 {
   if (mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return nsnull;
--- a/gfx/layers/opengl/LayerManagerOGL.h
+++ b/gfx/layers/opengl/LayerManagerOGL.h
@@ -128,17 +128,17 @@ public:
    * LayerManager implementation.
    */
   void BeginTransaction();
 
   void BeginTransactionWithTarget(gfxContext* aTarget);
 
   void EndConstruction();
 
-  virtual bool EndTransaction(DrawThebesLayerCallback aCallback,
+  virtual void EndTransaction(DrawThebesLayerCallback aCallback,
                               void* aCallbackData);
 
   virtual void SetRoot(Layer* aLayer) { mRoot = aLayer; }
 
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
 
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
 
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2384,18 +2384,17 @@ nsPresContext::IsRootContentDocument()
   return (f && f->PresContext()->IsChrome());
 }
 
 nsRootPresContext::nsRootPresContext(nsIDocument* aDocument,
                                      nsPresContextType aType)
   : nsPresContext(aDocument, aType),
     mUpdatePluginGeometryForFrame(nsnull),
     mDOMGeneration(0),
-    mNeedsToUpdatePluginGeometry(PR_FALSE),
-    mUpdateLayerTree(false)
+    mNeedsToUpdatePluginGeometry(PR_FALSE)
 {
   mRegisteredPlugins.Init();
 }
 
 nsRootPresContext::~nsRootPresContext()
 {
   NS_ASSERTION(mRegisteredPlugins.Count() == 0,
                "All plugins should have been unregistered");
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1270,28 +1270,24 @@ public:
    */
   void IncrementDOMGeneration() { mDOMGeneration++; }
 
   /**
    * Get the current DOM generation counter.
    */
   PRUint32 GetDOMGeneration() { return mDOMGeneration; }
 
-  void SetNeedToUpdateLayerTree(bool aUpdate) { mUpdateLayerTree = aUpdate; }
-  bool NeedToUpdateLayerTree() { return mUpdateLayerTree; }
-
 private:
   nsTHashtable<nsPtrHashKey<nsObjectFrame> > mRegisteredPlugins;
   // if mNeedsToUpdatePluginGeometry is set, then this is the frame to
   // use as the root of the subtree to search for plugin updates, or
   // null to use the root frame of this prescontext
   nsIFrame* mUpdatePluginGeometryForFrame;
   PRUint32 mDOMGeneration;
   PRPackedBool mNeedsToUpdatePluginGeometry;
-  bool mUpdateLayerTree;
 };
 
 inline void
 nsPresContext::ForgetUpdatePluginGeometryFrame(nsIFrame* aFrame)
 {
   if (mContainsUpdatePluginGeometryFrame) {
     nsRootPresContext* rootPC = GetRootPresContext();
     if (rootPC) {
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6068,29 +6068,16 @@ PresShell::Paint(nsIView*           aDis
   nsPresContext* presContext = GetPresContext();
   AUTO_LAYOUT_PHASE_ENTRY_POINT(presContext, Paint);
 
   NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
   NS_ASSERTION(aDisplayRoot, "null view");
   NS_ASSERTION(aViewToPaint, "null view");
   NS_ASSERTION(aWidgetToPaint, "Can't paint without a widget");
 
-  nsRootPresContext* rootPC = presContext->GetRootPresContext();
-  if (!rootPC->NeedToUpdateLayerTree() && aWidgetToPaint) {
-    LayerManager* layerManager = aWidgetToPaint->GetLayerManager();
-    NS_ASSERTION(layerManager, "Must be in paint event");
-    if (layerManager->IsNullTransactionSupported()) {
-      layerManager->BeginTransaction();
-      if (layerManager->EndTransaction(nsnull, nsnull)) {
-        return NS_OK;
-      }
-    }
-  }
-  rootPC->SetNeedToUpdateLayerTree(false);
-
   nscolor bgcolor = ComputeBackstopColor(aDisplayRoot);
 
   nsIFrame* frame = aPaintDefaultBackground
       ? nsnull : static_cast<nsIFrame*>(aDisplayRoot->GetClientData());
 
   if (frame && aViewToPaint == aDisplayRoot) {
     // Defer invalidates that are triggered during painting, and discard
     // invalidates of areas that are already being repainted.
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3945,24 +3945,17 @@ nsIFrame::InvalidateLayer(const nsRect& 
 {
   NS_ASSERTION(aDisplayItemKey > 0, "Need a key");
 
   if (!FrameLayerBuilder::HasDedicatedLayer(this, aDisplayItemKey)) {
     Invalidate(aDamageRect);
     return;
   }
 
-  nsRootPresContext* rootPC = PresContext()->GetRootPresContext();
-  PRUint32 flags = INVALIDATE_NO_THEBES_LAYERS;
-  if (aDisplayItemKey == nsDisplayItem::TYPE_VIDEO ||
-      aDisplayItemKey == nsDisplayItem::TYPE_PLUGIN) {
-    flags = INVALIDATE_NO_UPDATE_LAYER_TREE;
-  }
-
-  InvalidateWithFlags(aDamageRect, flags);
+  InvalidateWithFlags(aDamageRect, INVALIDATE_NO_THEBES_LAYERS);
 }
 
 class LayerActivity {
 public:
   LayerActivity(nsIFrame* aFrame) : mFrame(aFrame) {}
   ~LayerActivity();
   nsExpirationState* GetExpirationState() { return &mState; }
 
@@ -4046,28 +4039,22 @@ void
 nsIFrame::InvalidateWithFlags(const nsRect& aDamageRect, PRUint32 aFlags)
 {
   if (aDamageRect.IsEmpty()) {
     return;
   }
 
   // Don't allow invalidates to do anything when
   // painting is suppressed.
-  nsPresContext* context = PresContext();
-  nsIPresShell *shell = context->GetPresShell();
+  nsIPresShell *shell = PresContext()->GetPresShell();
   if (shell) {
     if (shell->IsPaintingSuppressed())
       return;
   }
 
-  if (!(aFlags & INVALIDATE_NO_UPDATE_LAYER_TREE)) {
-    nsRootPresContext* rootPC = context->GetRootPresContext();
-    rootPC->SetNeedToUpdateLayerTree(true);
-  }
-
   InvalidateInternal(aDamageRect, 0, 0, nsnull, aFlags);
 }
 
 /**
  * Helper function that funnels an InvalidateInternal request up to the
  * parent.  This function is used so that if MOZ_SVG is not defined, we still
  * have unified control paths in the InvalidateInternal chain.
  *
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2033,30 +2033,27 @@ public:
    * then invalidation in the current paint region is simply discarded.
    * Use this flag if areas that are being painted do not need
    * to be invalidated. By default, when this flag is not specified,
    * areas that are invalidated while currently being painted will be repainted
    * again.
    * This flag is useful when, during painting, FrameLayerBuilder discovers that
    * a region of the window needs to be drawn differently, and that region
    * may or may not be contained in the currently painted region.
-   * @param aFlags INVALIDATE_NO_UPDATE_LAYER_TREE: invalidate only in the Non-Thebes Layers
-   * Video, Plugin.
    */
   enum {
     INVALIDATE_IMMEDIATE = 0x01,
     INVALIDATE_CROSS_DOC = 0x02,
     INVALIDATE_REASON_SCROLL_BLIT = 0x04,
     INVALIDATE_REASON_SCROLL_REPAINT = 0x08,
     INVALIDATE_REASON_MASK = INVALIDATE_REASON_SCROLL_BLIT |
                              INVALIDATE_REASON_SCROLL_REPAINT,
     INVALIDATE_NO_THEBES_LAYERS = 0x10,
     INVALIDATE_ONLY_THEBES_LAYERS = 0x20,
-    INVALIDATE_EXCLUDE_CURRENT_PAINT = 0x40,
-    INVALIDATE_NO_UPDATE_LAYER_TREE = 0x80
+    INVALIDATE_EXCLUDE_CURRENT_PAINT = 0x40
   };
   virtual void InvalidateInternal(const nsRect& aDamageRect,
                                   nscoord aOffsetX, nscoord aOffsetY,
                                   nsIFrame* aForChild, PRUint32 aFlags);
 
   /**
    * Helper function that funnels an InvalidateInternal request up to the
    * parent.  This function is used so that if MOZ_SVG is not defined, we still