Bug 1060588: Use PushClipRect when possible in ClipToRegionInternal. r=jrmuizel

This commit is contained in:
Bas Schouten 2014-09-14 23:51:30 +02:00
parent 8ea600f53b
commit 2778731d55

View File

@ -709,6 +709,12 @@ static void
ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion,
bool aSnap)
{
if (!aRegion.IsComplex()) {
nsIntRect rect = aRegion.GetBounds();
aTarget->PushClipRect(Rect(rect.x, rect.y, rect.width, rect.height));
return;
}
RefPtr<Path> path = PathFromRegionInternal(aTarget, aRegion, aSnap);
aTarget->PushClip(path);
}