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.
--- 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();