diff --git a/gfx/src/nsRegion.cpp b/gfx/src/nsRegion.cpp index 4c4d4ae8560..3b0bec1e311 100644 --- a/gfx/src/nsRegion.cpp +++ b/gfx/src/nsRegion.cpp @@ -738,13 +738,24 @@ nsIntRegion nsRegion::ScaleToNearestPixels (float aScaleX, float aScaleY, nsIntRegion nsRegion::ScaleToOutsidePixels (float aScaleX, float aScaleY, nscoord aAppUnitsPerPixel) const { - nsIntRegion result; - for (auto iter = RectIter(); !iter.Done(); iter.Next()) { - mozilla::gfx::IntRect deviceRect = - iter.Get().ScaleToOutsidePixels(aScaleX, aScaleY, aAppUnitsPerPixel); - result.Or(result, deviceRect); + // make a copy of the region so that we can mutate it inplace + nsRegion region = *this; + int n; + pixman_box32_t *boxes = pixman_region32_rectangles(®ion.mImpl, &n); + boxes = pixman_region32_rectangles(®ion.mImpl, &n); + for (int i=0; i