Bug 1156636 - Remove post scale multiplication for event regions. r=roc
authorMorris Tseng <mtseng@mozilla.com>
Tue, 28 Apr 2015 01:46:00 +0200
changeset 273608 c9073aaaf9a6c941747accfde789f7c02ada887e
parent 273607 69703f8a1d40c556f263c88a6400162ec9eef93f
child 273609 1270c0cd3f5b81efe55b40308dfe27e0dbf7ce81
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1156636
milestone40.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 1156636 - Remove post scale multiplication for event regions. r=roc
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -3015,29 +3015,34 @@ void ContainerState::FinishPaintedLayerD
       data->mVerticalPanRegion.GetBounds(),
       mContainerReferenceFrame,
       containingPaintedLayerData->mReferenceFrame,
       &containingPaintedLayerData->mVerticalPanRegion,
       &containingPaintedLayerData->mDispatchToContentHitRegion);
 
   } else {
     EventRegions regions;
-    regions.mHitRegion = ScaleRegionToOutsidePixels(data->mHitRegion);
-    regions.mNoActionRegion = ScaleRegionToOutsidePixels(data->mNoActionRegion);
-    regions.mHorizontalPanRegion = ScaleRegionToOutsidePixels(data->mHorizontalPanRegion);
-    regions.mVerticalPanRegion = ScaleRegionToOutsidePixels(data->mVerticalPanRegion);
+    regions.mHitRegion =
+      data->mHitRegion.ToOutsidePixels(mAppUnitsPerDevPixel);
+    regions.mNoActionRegion =
+      data->mNoActionRegion.ToOutsidePixels(mAppUnitsPerDevPixel);
+    regions.mHorizontalPanRegion =
+      data->mHorizontalPanRegion.ToOutsidePixels(mAppUnitsPerDevPixel);
+    regions.mVerticalPanRegion =
+      data->mVerticalPanRegion.ToOutsidePixels(mAppUnitsPerDevPixel);
 
     // Points whose hit-region status we're not sure about need to be dispatched
     // to the content thread. If a point is in both maybeHitRegion and hitRegion
     // then it's not a "maybe" any more, and doesn't go into the dispatch-to-
     // content region.
-    nsIntRegion maybeHitRegion = ScaleRegionToOutsidePixels(data->mMaybeHitRegion);
+    nsIntRegion maybeHitRegion =
+      data->mMaybeHitRegion.ToOutsidePixels(mAppUnitsPerDevPixel);
     regions.mDispatchToContentHitRegion.Sub(maybeHitRegion, regions.mHitRegion);
     regions.mDispatchToContentHitRegion.OrWith(
-        ScaleRegionToOutsidePixels(data->mDispatchToContentHitRegion));
+        data->mDispatchToContentHitRegion.ToOutsidePixels(mAppUnitsPerDevPixel));
     regions.mHitRegion.OrWith(maybeHitRegion);
 
     Matrix mat = layer->GetBaseTransform().As2D();
     mat.Invert();
     regions.ApplyTranslationAndScale(mat._31, mat._32, mat._11, mat._22);
 
     layer->SetEventRegions(regions);
   }