Bug 1204597 - Use Move constructor for opaque region in FrameLayerBuilder instead of copying. r=jrmuizel
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 14 Sep 2015 14:18:20 -0400
changeset 296715 dde3b5e4c0163941ff8bfe55d3d6ac2d87dd80d4
parent 296714 4f9c34eb2d6175b2cb5b9b73a2389930f4294dd9
child 296716 01cf8bf2f3d71fae16dfd2dd52ffd3706edfa910
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1204597
milestone43.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 1204597 - Use Move constructor for opaque region in FrameLayerBuilder instead of copying. r=jrmuizel
gfx/src/nsRegion.cpp
layout/base/FrameLayerBuilder.cpp
--- a/gfx/src/nsRegion.cpp
+++ b/gfx/src/nsRegion.cpp
@@ -5,29 +5,30 @@
 
 #include "nsRegion.h"
 #include "nsPrintfCString.h"
 #include "nsTArray.h"
 #include "gfxUtils.h"
 
 bool nsRegion::Contains(const nsRegion& aRgn) const
 {
-  // XXX this could be made faster
+  // XXX this could be made faster by iterating over
+  // both regions at the same time some how
   nsRegionRectIterator iter(aRgn);
   while (const nsRect* r = iter.Next()) {
     if (!Contains (*r)) {
       return false;
     }
   }
   return true;
 }
 
 bool nsRegion::Intersects(const nsRect& aRect) const
 {
-  // XXX this could be made faster
+  // XXX this could be made faster by using pixman_region32_contains_rect
   nsRegionRectIterator iter(*this);
   while (const nsRect* r = iter.Next()) {
     if (r->Intersects(aRect)) {
       return true;
     }
   }
   return false;
 }
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -3401,17 +3401,17 @@ PaintedLayerData::Accumulate(ContainerSt
       // a canvas background), so we need to make sure that the first rect
       // we see doesn't get discarded.
       nsIntRegion tmp;
       tmp.Or(mOpaqueRegion, *r);
        // Opaque display items in chrome documents whose window is partially
        // transparent are always added to the opaque region. This helps ensure
        // that we get as much subpixel-AA as possible in the chrome.
        if (tmp.GetNumRects() <= 4 || aItem->Frame()->PresContext()->IsChrome()) {
-        mOpaqueRegion = tmp;
+        mOpaqueRegion = Move(tmp);
       }
     }
   }
 
   if (!aState->mParameters.mDisableSubpixelAntialiasingInDescendants) {
     nsRect componentAlpha = aItem->GetComponentAlphaBounds(aState->mBuilder);
     if (!componentAlpha.IsEmpty()) {
       nsIntRect componentAlphaRect =