Bug 1156636 - Remove post scale multiplication for event regions. r=roc

This commit is contained in:
Morris Tseng 2015-04-28 01:46:00 +02:00
parent fa466bc83d
commit 908b2e6554

View File

@ -3020,19 +3020,24 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
} 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();