Bug 1077842 - Simplify invalid regions for tiled painted layers to avoid complex region operations. r=jrmuizel
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 08 Oct 2014 13:12:25 +1300
changeset 209248 81eafec98b48dad1ae75659cdc3235bf7e5c8be0
parent 209247 43c963b56723f6d318bdda0eb906d3cb5b08717a
child 209249 f622aedd4348c7b0cff5f166859eee571b010b79
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjrmuizel
bugs1077842
milestone35.0a1
Bug 1077842 - Simplify invalid regions for tiled painted layers to avoid complex region operations. r=jrmuizel
gfx/layers/client/ClientTiledPaintedLayer.h
--- a/gfx/layers/client/ClientTiledPaintedLayer.h
+++ b/gfx/layers/client/ClientTiledPaintedLayer.h
@@ -50,18 +50,19 @@ protected:
 public:
   // Override name to distinguish it from ClientPaintedLayer in layer dumps
   virtual const char* Name() const { return "TiledPaintedLayer"; }
 
   // PaintedLayer
   virtual Layer* AsLayer() { return this; }
   virtual void InvalidateRegion(const nsIntRegion& aRegion) {
     mInvalidRegion.Or(mInvalidRegion, aRegion);
-    mValidRegion.Sub(mValidRegion, aRegion);
-    mLowPrecisionValidRegion.Sub(mLowPrecisionValidRegion, aRegion);
+    mInvalidRegion.SimplifyOutward(20);
+    mValidRegion.Sub(mValidRegion, mInvalidRegion);
+    mLowPrecisionValidRegion.Sub(mLowPrecisionValidRegion, mInvalidRegion);
   }
 
   // Shadow methods
   virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs);
   virtual ShadowableLayer* AsShadowableLayer() { return this; }
 
   virtual void Disconnect()
   {