Closed Bug 1389143 Opened 3 years ago Closed 3 years ago

Implement a basic hit-testing mechanism for APZ (in the C++ code)

Categories

(Core :: Graphics: WebRender, enhancement, P3)

Other Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(4 files)

Right now in layers-free webrender mode, APZ doesn't get any hit-testing information. In the long term we want to do hit-testing in WebRender but I think in the short term it makes sense to stand up some hit-testing in C++ code, reusing the existing APZ codepaths. It's not a lot of work (I have some patches already) but it will likely have poor performance. Still, it will allow us to turn on APZ sooner, which means we can run APZ-enabled reftests sooner, which I think will help development overall and avoid regressions when working on the more complete hit-test solution.
See Also: → 1389146
With these patches applied (and with everything else that's landed) APZ mostly works in layers-free mode. I'm sure there's a lot of edge cases and whatnot that aren't hooked up properly but basic scrolling seems ok.
Comment on attachment 8898878 [details]
Bug 1389143 - Send event regions items over to APZ in layers-free mode.

https://reviewboard.mozilla.org/r/170238/#review175436

::: gfx/layers/LayersTypes.h:166
(Diff revision 1)
> +  {
> +    mHitRegion.OrWith(aOther.mHitRegion);
> +    mDispatchToContentHitRegion.OrWith(aOther.mDispatchToContentHitRegion);
> +    // See the comment in nsDisplayList::AddFrame, where the touch action regions
> +    // are handled. The same thing applies here.
> +    bool alreadyHadRegions = !mNoActionRegion.IsEmpty() ||

Sadly this logic is duplicated in a number of places but because it operates on slightly different inputs/data structures it's hard to refactor/reuse. See http://searchfox.org/mozilla-central/search?q=alreadyHadRegions for other places this pattern exists.
Comment on attachment 8898876 [details]
Bug 1389143 - Refactor to extract helper method.

https://reviewboard.mozilla.org/r/170234/#review175454
Attachment #8898876 - Flags: review?(jmuizelaar) → review+
Comment on attachment 8898877 [details]
Bug 1389143 - Preserve the lastASR tracker across recursions.

https://reviewboard.mozilla.org/r/170236/#review175456
Attachment #8898877 - Flags: review?(jmuizelaar) → review+
Comment on attachment 8898878 [details]
Bug 1389143 - Send event regions items over to APZ in layers-free mode.

https://reviewboard.mozilla.org/r/170238/#review175466
Attachment #8898878 - Flags: review?(jmuizelaar) → review+
Comment on attachment 8898879 [details]
Bug 1389143 - Send event regions override information to APZ in layers-free mode.

https://reviewboard.mozilla.org/r/170240/#review175468
Attachment #8898879 - Flags: review?(jmuizelaar) → review+
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/52917ec218cb
Refactor to extract helper method. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/a8b2d799b3c0
Preserve the lastASR tracker across recursions. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/81116c9af1b1
Send event regions items over to APZ in layers-free mode. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/46a3b3a3ae70
Send event regions override information to APZ in layers-free mode. r=jrmuizel
You need to log in before you can comment on or make changes to this bug.