Bug 1547624 - Update mScaledHitRegionBounds when we add hit-test info to a Layer from within an inactive Layer. r=miko

Differential Revision: https://phabricator.services.mozilla.com/D32260

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matt Woodrow 2019-05-27 04:27:18 +00:00
parent a0327e4b32
commit ded3b88d3a

View File

@ -630,6 +630,8 @@ class PaintedLayerData {
const DisplayItemClip& aClip,
TransformClipNode* aTransform);
void HitRegionsUpdated();
/**
* If this represents only a nsDisplayImage, and the image type supports being
* optimized to an ImageLayer, returns true.
@ -651,6 +653,11 @@ class PaintedLayerData {
return !mVisibleRegion.Intersect(aRegion).IsEmpty();
}
/**
* The owning ContainerState that created this PaintedLayerData.
*/
ContainerState* mState;
/**
* The region of visible content in the layer, relative to the
* container layer (which is at the snapped top-left of the display
@ -3617,6 +3624,7 @@ void ContainerState::FinishPaintedLayerData(
containingPaintedLayerData->mDispatchToContentHitRegion.OrWith(
containingPaintedLayerData->CombinedTouchActionRegion());
}
containingPaintedLayerData->HitRegionsUpdated();
} else {
EventRegions regions(
ScaleRegionToOutsidePixels(data->mHitRegion),
@ -4047,11 +4055,15 @@ void PaintedLayerData::AccumulateHitTestItem(ContainerState* aState,
mMaybeHitRegion.SimplifyOutward(8);
mDispatchToContentHitRegion.SimplifyOutward(8);
HitRegionsUpdated();
}
void PaintedLayerData::HitRegionsUpdated() {
// Calculate scaled versions of the bounds of mHitRegion and mMaybeHitRegion
// for quick access in FindPaintedLayerFor().
mScaledHitRegionBounds = aState->ScaleToOutsidePixels(mHitRegion.GetBounds());
mScaledHitRegionBounds = mState->ScaleToOutsidePixels(mHitRegion.GetBounds());
mScaledMaybeHitRegionBounds =
aState->ScaleToOutsidePixels(mMaybeHitRegion.GetBounds());
mState->ScaleToOutsidePixels(mMaybeHitRegion.GetBounds());
}
void ContainerState::NewPaintedLayerData(
@ -4059,6 +4071,7 @@ void ContainerState::NewPaintedLayerData(
const ActiveScrolledRoot* aASR, const DisplayItemClipChain* aClipChain,
const ActiveScrolledRoot* aScrollMetadataASR, const nsPoint& aTopLeft,
const nsIFrame* aReferenceFrame, const bool aBackfaceHidden) {
aData->mState = this;
aData->mAnimatedGeometryRoot = aAnimatedGeometryRoot;
aData->mASR = aASR;
aData->mClipChain = aClipChain;