Bug 1119089. Switch from the ineffecient x = x.sub(x, y) to x.subout(y);
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 07 Jan 2015 21:18:57 -0500
changeset 248414 88492808aea554d9c0e6222874a2fb971a391589
parent 248413 6d8e998d62122ef75626c0889f9185977b229cc1
child 248415 8fa274cce61603fd43290624d639c8cae9e80b8b
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1119089
milestone37.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 1119089. Switch from the ineffecient x = x.sub(x, y) to x.subout(y); The recently added move assignment operators make the existing pattern more efficient, but using SubOut() is cleaner and even more efficient.
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -1277,18 +1277,18 @@ ClientTiledLayerBuffer::ValidateTile(Til
 
   ctxt = nullptr;
   drawTarget = nullptr;
 
   nsIntRegion tileRegion =
     nsIntRect(aTileOrigin.x, aTileOrigin.y,
               GetScaledTileSize().width, GetScaledTileSize().height);
   // Intersect this area with the portion that's invalid.
-  tileRegion = tileRegion.Sub(tileRegion, GetValidRegion());
-  tileRegion = tileRegion.Sub(tileRegion, aDirtyRegion); // Has now been validated
+  tileRegion.SubOut(GetValidRegion());
+  tileRegion.SubOut(aDirtyRegion); // Has now been validated
 
   backBuffer->SetWaste(tileRegion.Area() * mResolution * mResolution);
   backBuffer->Unlock();
 
   if (createdTextureClient) {
     if (!mCompositableClient->AddTextureClient(backBuffer)) {
       NS_WARNING("Failed to add tile TextureClient.");
       aTile.DiscardFrontBuffer();