Bug 1452111 - Simplify dispatch-to-content regions as well. r=mattwoodrow
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 13 Apr 2018 12:51:59 -0400
changeset 466917 0c7db264c68e1f3074462cc17c488047a16f85c4
parent 466895 ffcb6aa7e8717e58ee14e13eb370e2f902c9d03c
child 466918 bd0a3fdb037c308ae7eab0be3c68d00fcb9b6056
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1452111
milestone61.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 1452111 - Simplify dispatch-to-content regions as well. r=mattwoodrow We already do this for the maybe-hit regions because on some pages we can get oodles and oodles of regions and unioning them all takes a long time. Simplifying the regions speeds this up massively. It should be functionally correct since the dispatch-to-content region is allowed to overestimate the actual dispatch-to-content region. MozReview-Commit-ID: 6Wl5nuVXB7w
layout/painting/FrameLayerBuilder.cpp
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -3485,16 +3485,17 @@ void ContainerState::FinishPaintedLayerD
         mContainerReferenceFrame,
         data->mDispatchToContentHitRegion.GetBounds(),
         containingPaintedLayerData->mReferenceFrame);
       if (inactiveLayerClip) {
         rect = inactiveLayerClip->ApplyNonRoundedIntersection(rect);
       }
       containingPaintedLayerData->mDispatchToContentHitRegion.Or(
         containingPaintedLayerData->mDispatchToContentHitRegion, rect);
+      containingPaintedLayerData->mDispatchToContentHitRegion.SimplifyOutward(8);
       if (data->mDTCRequiresTargetConfirmation) {
         containingPaintedLayerData->mDTCRequiresTargetConfirmation = true;
       }
     }
     if (!data->mMaybeHitRegion.GetBounds().IsEmpty()) {
       nsRect rect = nsLayoutUtils::TransformFrameRectToAncestor(
         mContainerReferenceFrame,
         data->mMaybeHitRegion.GetBounds(),
@@ -3812,16 +3813,17 @@ PaintedLayerData::AccumulateEventRegions
   mVerticalPanRegion.OrWith(aEventRegions->VerticalPanRegion());
   if (alreadyHadRegions) {
     mDispatchToContentHitRegion.OrWith(CombinedTouchActionRegion());
   }
 
   // Avoid quadratic performance as a result of the region growing to include
   // and arbitrarily large number of rects, which can happen on some pages.
   mMaybeHitRegion.SimplifyOutward(8);
+  mDispatchToContentHitRegion.SimplifyOutward(8);
 
   // Calculate scaled versions of the bounds of mHitRegion and mMaybeHitRegion
   // for quick access in FindPaintedLayerFor().
   mScaledHitRegionBounds = aState->ScaleToOutsidePixels(mHitRegion.GetBounds());
   mScaledMaybeHitRegionBounds = aState->ScaleToOutsidePixels(mMaybeHitRegion.GetBounds());
 }
 
 void
@@ -3916,16 +3918,17 @@ PaintedLayerData::AccumulateHitTestInfo(
 
   if (alreadyHadRegions > 1) {
     mDispatchToContentHitRegion.OrWith(CombinedTouchActionRegion());
   }
 
   // Avoid quadratic performance as a result of the region growing to include
   // and arbitrarily large number of rects, which can happen on some pages.
   mMaybeHitRegion.SimplifyOutward(8);
+  mDispatchToContentHitRegion.SimplifyOutward(8);
 
   // Calculate scaled versions of the bounds of mHitRegion and mMaybeHitRegion
   // for quick access in FindPaintedLayerFor().
   mScaledHitRegionBounds =
     aState->ScaleToOutsidePixels(mHitRegion.GetBounds());
   mScaledMaybeHitRegionBounds =
     aState->ScaleToOutsidePixels(mMaybeHitRegion.GetBounds());
 }