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 235612 88492808aea554d9c0e6222874a2fb971a391589
parent 235611 6d8e998d62122ef75626c0889f9185977b229cc1
child 235613 8fa274cce61603fd43290624d639c8cae9e80b8b
push id366
push usercmanchester@mozilla.com
push dateThu, 08 Jan 2015 16:40:24 +0000
bugs1119089
milestone37.0a1
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();