mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 1389143 - Refactor to extract helper method. r=jrmuizel
MozReview-Commit-ID: 5FxrP280i5m --HG-- extra : rebase_source : 5ca1f3f42d013b1b5adfa64caf061b170e700092
This commit is contained in:
parent
89677ada26
commit
975c4c2802
@ -51,6 +51,26 @@ CSSFilter ToCSSFilter(const nsStyleFilter& filter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EventRegions::EventRegions(const nsIntRegion& aHitRegion,
|
||||||
|
const nsIntRegion& aMaybeHitRegion,
|
||||||
|
const nsIntRegion& aDispatchToContentRegion,
|
||||||
|
const nsIntRegion& aNoActionRegion,
|
||||||
|
const nsIntRegion& aHorizontalPanRegion,
|
||||||
|
const nsIntRegion& aVerticalPanRegion)
|
||||||
|
{
|
||||||
|
mHitRegion = aHitRegion;
|
||||||
|
mNoActionRegion = aNoActionRegion;
|
||||||
|
mHorizontalPanRegion = aHorizontalPanRegion;
|
||||||
|
mVerticalPanRegion = aVerticalPanRegion;
|
||||||
|
// 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.
|
||||||
|
mDispatchToContentHitRegion.Sub(aMaybeHitRegion, mHitRegion);
|
||||||
|
mDispatchToContentHitRegion.OrWith(aDispatchToContentRegion);
|
||||||
|
mHitRegion.OrWith(aMaybeHitRegion);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
@ -110,6 +110,16 @@ struct EventRegions {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This constructor takes the maybe-hit region and uses it to update the
|
||||||
|
// hit region and dispatch-to-content region. It is useful from converting
|
||||||
|
// from the display item representation to the layer representation.
|
||||||
|
EventRegions(const nsIntRegion& aHitRegion,
|
||||||
|
const nsIntRegion& aMaybeHitRegion,
|
||||||
|
const nsIntRegion& aDispatchToContentRegion,
|
||||||
|
const nsIntRegion& aNoActionRegion,
|
||||||
|
const nsIntRegion& aHorizontalPanRegion,
|
||||||
|
const nsIntRegion& aVerticalPanRegion);
|
||||||
|
|
||||||
bool operator==(const EventRegions& aRegions) const
|
bool operator==(const EventRegions& aRegions) const
|
||||||
{
|
{
|
||||||
return mHitRegion == aRegions.mHitRegion &&
|
return mHitRegion == aRegions.mHitRegion &&
|
||||||
|
@ -3396,20 +3396,13 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
|
|||||||
containingPaintedLayerData->CombinedTouchActionRegion());
|
containingPaintedLayerData->CombinedTouchActionRegion());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EventRegions regions;
|
EventRegions regions(
|
||||||
regions.mHitRegion = ScaleRegionToOutsidePixels(data->mHitRegion);
|
ScaleRegionToOutsidePixels(data->mHitRegion),
|
||||||
regions.mNoActionRegion = ScaleRegionToOutsidePixels(data->mNoActionRegion);
|
ScaleRegionToOutsidePixels(data->mMaybeHitRegion),
|
||||||
regions.mHorizontalPanRegion = ScaleRegionToOutsidePixels(data->mHorizontalPanRegion);
|
ScaleRegionToOutsidePixels(data->mDispatchToContentHitRegion),
|
||||||
regions.mVerticalPanRegion = ScaleRegionToOutsidePixels(data->mVerticalPanRegion);
|
ScaleRegionToOutsidePixels(data->mNoActionRegion),
|
||||||
// Points whose hit-region status we're not sure about need to be dispatched
|
ScaleRegionToOutsidePixels(data->mHorizontalPanRegion),
|
||||||
// to the content thread. If a point is in both maybeHitRegion and hitRegion
|
ScaleRegionToOutsidePixels(data->mVerticalPanRegion));
|
||||||
// then it's not a "maybe" any more, and doesn't go into the dispatch-to-
|
|
||||||
// content region.
|
|
||||||
nsIntRegion maybeHitRegion = ScaleRegionToOutsidePixels(data->mMaybeHitRegion);
|
|
||||||
regions.mDispatchToContentHitRegion.Sub(maybeHitRegion, regions.mHitRegion);
|
|
||||||
regions.mDispatchToContentHitRegion.OrWith(
|
|
||||||
ScaleRegionToOutsidePixels(data->mDispatchToContentHitRegion));
|
|
||||||
regions.mHitRegion.OrWith(maybeHitRegion);
|
|
||||||
|
|
||||||
Matrix mat = layer->GetTransform().As2D();
|
Matrix mat = layer->GetTransform().As2D();
|
||||||
mat.Invert();
|
mat.Invert();
|
||||||
|
Loading…
Reference in New Issue
Block a user