Bug 1001845 - Simplify invalid regions to avoid spending excessive amounts of time in region code. r=roc

This commit is contained in:
Matt Woodrow 2014-04-28 16:17:31 +12:00
parent c332098d85
commit a7147dc432
5 changed files with 6 additions and 1 deletions

View File

@ -59,12 +59,14 @@ AddTransformedRegion(nsIntRegion& aDest, const nsIntRegion& aSource, const gfx3D
while ((r = iter.Next())) {
aDest.Or(aDest, TransformRect(*r, aTransform));
}
aDest.SimplifyOutward(20);
}
static void
AddRegion(nsIntRegion& aDest, const nsIntRegion& aSource)
{
aDest.Or(aDest, aSource);
aDest.SimplifyOutward(20);
}
static nsIntRegion

View File

@ -53,6 +53,7 @@ public:
NS_ASSERTION(BasicManager()->InConstruction(),
"Can only set properties in construction phase");
mInvalidRegion.Or(mInvalidRegion, aRegion);
mInvalidRegion.SimplifyOutward(20);
mValidRegion.Sub(mValidRegion, mInvalidRegion);
}

View File

@ -60,6 +60,7 @@ public:
NS_ASSERTION(ClientManager()->InConstruction(),
"Can only set properties in construction phase");
mInvalidRegion.Or(mInvalidRegion, aRegion);
mInvalidRegion.SimplifyOutward(20);
mValidRegion.Sub(mValidRegion, mInvalidRegion);
}

View File

@ -47,7 +47,7 @@ void
ThebesLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion)
{
mInvalidRegion.Or(mInvalidRegion, aRegion);
mInvalidRegion.SimplifyOutward(10);
mInvalidRegion.SimplifyOutward(20);
mValidRegion.Sub(mValidRegion, mInvalidRegion);
}

View File

@ -50,6 +50,7 @@ void
ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
{
mInvalidRegion.Or(mInvalidRegion, aRegion);
mInvalidRegion.SimplifyOutward(20);
mValidRegion.Sub(mValidRegion, mInvalidRegion);
}