Bug 1148235. Cleanup the state that we maintain in SimplifyOutwardByArea. r=ehsan
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 27 Mar 2015 14:22:07 -0400
changeset 265144 5000b940578b090d416273fe88a10c18deec86ba
parent 265143 6fb980e58948e688e2c794e4ec006f2c6ca831c2
child 265145 0cc8abe4e2bbcc18e0bf45d6fa77ac3484e9f0fc
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1148235
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1148235. Cleanup the state that we maintain in SimplifyOutwardByArea. r=ehsan Useless assignment removed and move a duplicated assignment out of the condition.
gfx/src/nsRegion.cpp
--- a/gfx/src/nsRegion.cpp
+++ b/gfx/src/nsRegion.cpp
@@ -331,33 +331,33 @@ void nsRegion::SimplifyOutwardByArea(uin
     }
     uint32_t totalArea = ComputeMergedAreaIncrease(topRects, topRectsEnd,
                                                    bottomRects, bottomRectsEnd);
 
     if (totalArea <= aThreshold) {
       // merge the rects into tmpRect
       rect = MergeRects(topRects, topRectsEnd, bottomRects, bottomRectsEnd, tmpRect);
 
+      // set topRects to where the newly merged rects will be so that we use them
+      // as our next set of topRects
+      topRects = destRect;
       // copy the merged rects back into the destination
       topRectsEnd = CopyRow(destRect, tmpRect, rect);
-      topRects = destRect;
-      bottomRects = bottomRectsEnd;
-      destRect = topRects;
     } else {
       // copy the unmerged rects
       destRect = CopyRow(destRect, topRects, topRectsEnd);
 
       topRects = bottomRects;
       topRectsEnd = bottomRectsEnd;
-      bottomRects = bottomRectsEnd;
       if (bottomRectsEnd == end) {
         // copy the last row when we are done
         topRectsEnd = CopyRow(destRect, topRects, topRectsEnd);
       }
     }
+    bottomRects = bottomRectsEnd;
   } while (bottomRectsEnd != end);
 
 
   uint32_t reducedCount = topRectsEnd - pixman_region32_rectangles(&this->mImpl, &n);
   // pixman has a special representation for
   // regions of 1 rectangle. So just use the
   // bounds in that case
   if (reducedCount > 1) {