diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 728a64a4f780..af24930625ff 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -115,7 +115,7 @@ struct LayerPropertiesBase : public LayerProperties } result = result.Union(ComputeChangeInternal(aCallback)); - result = result.Union(TransformRect(mLayer->GetInvalidRegion().GetBounds(), mTransform)); + result = result.Union(TransformRect(mLayer->GetInvalidRect(), mTransform)); if (mMaskLayer && otherMask) { nsIntRect maskDiff = mMaskLayer->ComputeChange(aCallback); diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 9ae81e9333c5..07dd81a50011 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -923,23 +923,23 @@ public: * Returns the current area of the layer (in layer-space coordinates) * marked as needed to be recomposited. */ - const nsIntRegion& GetInvalidRegion() { return mInvalidRegion; } + const nsIntRect& GetInvalidRect() { return mInvalidRect; } /** * Mark the entirety of the layer's visible region as being invalid. */ - void SetInvalidRectToVisibleRegion() { mInvalidRegion = GetVisibleRegion(); } + void SetInvalidRectToVisibleRegion() { mInvalidRect = GetVisibleRegion().GetBounds(); } /** * Adds to the current invalid rect. */ - void AddInvalidRect(const nsIntRect& aRect) { mInvalidRegion.Or(mInvalidRegion, aRect); } + void AddInvalidRect(const nsIntRect& aRect) { mInvalidRect = mInvalidRect.Union(aRect); } /** * Clear the invalid rect, marking the layer as being identical to what is currently * composited. */ - void ClearInvalidRect() { mInvalidRegion.SetEmpty(); } + void ClearInvalidRect() { mInvalidRect.SetEmpty(); } #ifdef DEBUG @@ -1006,13 +1006,13 @@ protected: float mOpacity; nsIntRect mClipRect; nsIntRect mTileSourceRect; + nsIntRect mInvalidRect; PRUint32 mContentFlags; bool mUseClipRect; bool mUseTileSourceRect; bool mIsFixedPosition; gfxPoint mAnchor; DebugOnly mDebugColorIndex; - nsIntRegion mInvalidRegion; }; /** diff --git a/gfx/layers/basic/BasicThebesLayer.h b/gfx/layers/basic/BasicThebesLayer.h index 27fd8773f0ce..77f62094361f 100644 --- a/gfx/layers/basic/BasicThebesLayer.h +++ b/gfx/layers/basic/BasicThebesLayer.h @@ -37,9 +37,8 @@ public: { NS_ASSERTION(BasicManager()->InConstruction(), "Can only set properties in construction phase"); - mInvalidRegion.Or(mInvalidRegion, aRegion); - mInvalidRegion.SimplifyOutward(10); - mValidRegion.Sub(mValidRegion, mInvalidRegion); + mValidRegion.Sub(mValidRegion, aRegion); + AddInvalidRect(aRegion.GetBounds()); } virtual void PaintThebes(gfxContext* aContext, diff --git a/gfx/layers/d3d10/ThebesLayerD3D10.cpp b/gfx/layers/d3d10/ThebesLayerD3D10.cpp index 1f1ede0f91e1..3f4906b07b44 100644 --- a/gfx/layers/d3d10/ThebesLayerD3D10.cpp +++ b/gfx/layers/d3d10/ThebesLayerD3D10.cpp @@ -53,9 +53,8 @@ void ThebesLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion) { - mInvalidRegion.Or(mInvalidRegion, aRegion); - mInvalidRegion.SimplifyOutward(10); - mValidRegion.Sub(mValidRegion, mInvalidRegion); + mValidRegion.Sub(mValidRegion, aRegion); + AddInvalidRect(aRegion.GetBounds()); } void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcOffset, diff --git a/gfx/layers/d3d9/ThebesLayerD3D9.cpp b/gfx/layers/d3d9/ThebesLayerD3D9.cpp index 0be6007c749f..9b973e624405 100644 --- a/gfx/layers/d3d9/ThebesLayerD3D9.cpp +++ b/gfx/layers/d3d9/ThebesLayerD3D9.cpp @@ -47,9 +47,8 @@ ThebesLayerD3D9::~ThebesLayerD3D9() void ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion) { - mInvalidRegion.Or(mInvalidRegion, aRegion); - mInvalidRegion.SimplifyOutward(10); - mValidRegion.Sub(mValidRegion, mInvalidRegion); + mValidRegion.Sub(mValidRegion, aRegion); + AddInvalidRect(aRegion.GetBounds()); } void diff --git a/gfx/layers/opengl/ThebesLayerOGL.cpp b/gfx/layers/opengl/ThebesLayerOGL.cpp index 8c33d409baee..5614c5a96578 100644 --- a/gfx/layers/opengl/ThebesLayerOGL.cpp +++ b/gfx/layers/opengl/ThebesLayerOGL.cpp @@ -784,9 +784,8 @@ ThebesLayerOGL::SetVisibleRegion(const nsIntRegion &aRegion) void ThebesLayerOGL::InvalidateRegion(const nsIntRegion &aRegion) { - mInvalidRegion.Or(mInvalidRegion, aRegion); - mInvalidRegion.SimplifyOutward(10); - mValidRegion.Sub(mValidRegion, mInvalidRegion); + mValidRegion.Sub(mValidRegion, aRegion); + AddInvalidRect(aRegion.GetBounds()); } void diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 0537cd0f3e6d..61c3bac4a7e2 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -675,8 +675,6 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, nsIntRect invalid; if (props) { invalid = props->ComputeDifferences(root, computeInvalidFunc); - } else if (widgetTransaction) { - LayerProperties::ClearInvalidations(root); } if (view) { diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 1a1e4674bcc0..52236140ac7d 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -5275,8 +5275,6 @@ PresShell::Paint(nsIView* aViewToPaint, nsIntRect invalid; if (props) { invalid = props->ComputeDifferences(layerManager->GetRoot(), computeInvalidFunc); - } else { - LayerProperties::ClearInvalidations(layerManager->GetRoot()); } if (!invalid.IsEmpty()) { if (props) {