Bug 1451099. Avoid expensive debugging matrix transform.
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sun, 01 Apr 2018 11:57:14 -0400
changeset 776883 ac2a749537595eda3b5d048ef379ac40e3241029
parent 776872 917f8c2a17daf42b40be516605cd0b4ed893b1d1
child 776884 d689df4e6f49f8ce04042408adce72db62f8e3ba
child 776888 fac38e508661a43c52c5ae2aa75e7bf130073571
child 777502 4b91ee05ddbfd7a02b60026a387d65464825f891
push id105029
push userbmo:jmuizelaar@mozilla.com
push dateTue, 03 Apr 2018 21:31:58 +0000
bugs1451099
milestone61.0a1
Bug 1451099. Avoid expensive debugging matrix transform.
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -351,25 +351,20 @@ struct DIGroup
        mInvalidRect.x, mInvalidRect.y, mInvalidRect.width, mInvalidRect.height);
     if (!aData->mGeometry) {
       // This item is being added for the first time, invalidate its entire area.
       UniquePtr<nsDisplayItemGeometry> geometry(aItem->AllocateGeometry(aBuilder));
       combined = clip.ApplyNonRoundedIntersection(geometry->ComputeInvalidationRegion());
       aData->mGeometry = Move(geometry);
       nsRect bounds = combined.GetBounds();
 
-      auto transBounds = nsLayoutUtils::MatrixTransformRect(bounds,
-                                                            Matrix4x4::From2D(aMatrix),
-                                                            float(appUnitsPerDevPixel));
-
       IntRect transformedRect = ToDeviceSpace(combined.GetBounds(), aMatrix, appUnitsPerDevPixel, mGroupOffset);
       ToDeviceSpace(combined.GetBounds(), aMatrix, appUnitsPerDevPixel, mGroupOffset);
       aData->mRect = transformedRect.Intersect(imageRect);
       GP("CGC %s %d %d %d %d\n", aItem->Name(), bounds.x, bounds.y, bounds.width, bounds.height);
-      GP("transBounds %d %d %d %d\n", transBounds.x, transBounds.y, transBounds.width, transBounds.height);
       GP("%d %d,  %f %f\n", mGroupOffset.x, mGroupOffset.y, aMatrix._11, aMatrix._22);
       GP("mRect %d %d %d %d\n", aData->mRect.x, aData->mRect.y, aData->mRect.width, aData->mRect.height);
       InvalidateRect(aData->mRect);
       aData->mInvalid = true;
     } else if (/*aData->mIsInvalid || XXX: handle image load invalidation */ (aItem->IsInvalid(invalid) && invalid.IsEmpty())) {
       MOZ_RELEASE_ASSERT(imageRect.IsEqualEdges(aData->mImageRect));
       MOZ_RELEASE_ASSERT(mGroupOffset == aData->mGroupOffset);
       UniquePtr<nsDisplayItemGeometry> geometry(aItem->AllocateGeometry(aBuilder));