Closed
Bug 1409446
Opened 7 years ago
Closed 7 years ago
Rewrite the ScrollingLayersHelper code to use the explicit parent APIs
Categories
(Core :: Graphics: WebRender, enhancement, P1)
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox57 | --- | unaffected |
firefox58 | --- | unaffected |
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: [wr-mvp] [gfx-noted])
Attachments
(12 files)
59 bytes,
text/x-review-board-request
|
jrmuizel
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
jrmuizel
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
jrmuizel
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
ethlin
:
review+
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
ethlin
:
review+
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
mstange
:
review+
|
Details |
Splitting off this bug as an intermediate step to fixing bug 1405359. Right now when defining a clip or a scroll layer, we are required to define it only after pushing the appropriate ancestor onto the stack. In servo/webrender#1796 (later modified with #1849 and #1857) I added an API that allows us to explicitly pass the desired ancestor id when defining a clip or scroll layer. This allows us to skip the pushing/popping of the ancestor.
This bug is to update ScrollingLayersHelper to use this new API and save on some of the pushing/popping that happens.
Assignee | ||
Comment 1•7 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Status: NEW → ASSIGNED
Priority: P3 → P1
Whiteboard: [gfx-noted][wr-mvp][triage] → [wr-mvp] [gfx-noted]
Updated•7 years ago
|
Comment 14•7 years ago
|
||
mozreview-review |
Comment on attachment 8919427 [details]
Bug 1409446 - Wire up the DefineClip and DefineScrollLayer APIs to allow specifying ancestry.
https://reviewboard.mozilla.org/r/190254/#review195592
Attachment #8919427 -
Flags: review?(jmuizelaar) → review+
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8919428 [details]
Bug 1409446 - Remove unused function.
https://reviewboard.mozilla.org/r/190256/#review195596
Attachment #8919428 -
Flags: review?(jmuizelaar) → review+
Comment 16•7 years ago
|
||
mozreview-review |
Comment on attachment 8919429 [details]
Bug 1409446 - Unify the clip stack in WebRenderAPI.
https://reviewboard.mozilla.org/r/190258/#review195598
Attachment #8919429 -
Flags: review?(jmuizelaar) → review+
Comment 17•7 years ago
|
||
mozreview-review |
Comment on attachment 8919431 [details]
Bug 1409446 - Modify the extra-clip flag to instead track more useful information.
https://reviewboard.mozilla.org/r/190262/#review195754
Attachment #8919431 -
Flags: review?(ethlin) → review+
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8919436 [details]
Bug 1409446 - Treat sticky clips as out-of-band clips.
https://reviewboard.mozilla.org/r/190272/#review195756
Attachment #8919436 -
Flags: review?(ethlin) → review+
Assignee | ||
Comment 19•7 years ago
|
||
Assignee | ||
Comment 20•7 years ago
|
||
Rebased: https://treeherder.mozilla.org/#/jobs?repo=try&revision=98e15119f4ce6248225ee7e7db4b333434effa3d
I also deleted the TODO at [1] in the "Treat sticky clips as out-of-band clips." patch, because that patch addresses the TODO.
[1] http://searchfox.org/mozilla-central/rev/1c4da216e00ac95b38a3f236e010b31cdfaae03b/layout/painting/nsDisplayList.cpp#7088
Assignee | ||
Comment 21•7 years ago
|
||
Assignee | ||
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
mozreview-review |
Comment on attachment 8919430 [details]
Bug 1409446 - Write the new recursive method to define clip chains.
https://reviewboard.mozilla.org/r/190260/#review196920
::: gfx/layers/wr/ScrollingLayersHelper.cpp:102
(Diff revision 1)
> + // aChain->mASR == aAsr => recurse(aAsr, aChain->mParent),
> + // then define aChain
> + // aChain->mASR != aAsr => recurse(aAsr->mParent, aChain),
> + // then define aAsr
> + //
> + // These basically be collapsed down into two codepaths; one that recurses
I think this is missing the word "can"
::: gfx/layers/wr/ScrollingLayersHelper.cpp:110
(Diff revision 1)
> + if (aChain && aChain->mASR == aAsr) {
> + return RecurseAndDefineClip(aItem, aAsr, aChain, aAppUnitsPerDevPixel, aStackingContext, aCache);
> + }
> + if (aAsr) {
> + return RecurseAndDefineAsr(aItem, aAsr, aChain, aAppUnitsPerDevPixel, aStackingContext, aCache);
> + }
> +
> + MOZ_ASSERT(!aChain && !aAsr);
Especially looking at the assert below, the if statements seem a bit verbose. It seems the "return RecourseAndDefineClip(...)" could just happen inside a single if (aChain || aAsr) {...}. Or did you do it the way you did it to stay closer to the comment above?
Attachment #8919430 -
Flags: review?(mstange) → review+
Comment 24•7 years ago
|
||
mozreview-review |
Comment on attachment 8919431 [details]
Bug 1409446 - Modify the extra-clip flag to instead track more useful information.
https://reviewboard.mozilla.org/r/190262/#review197736
I'm a bit unhappy about the layering violation where renderers now need to know about nsDisplayItem, but I don't have any good ideas for how to avoid that.
::: gfx/webrender_bindings/WebRenderAPI.h:432
(Diff revision 1)
> - uint32_t mExtraClipCount;
> + // clips that are generated by display items but that ScrollingLayersHelper
> + // doesn't know about. These are called "cache overrides" because while we're
> + // inside one of these clips, the WR clip stack is different from what
> + // ScrollingLayersHelper thinks it actually is (because of the out-of-band
> + // clip that was pushed onto the stack) and so ScrollingLayersHelper cannot
> + // use it's clip cache as-is. Instead, any time ScrollingLayersHelper wants
it's -> its
Attachment #8919431 -
Flags: review?(mstange) → review+
Comment 25•7 years ago
|
||
mozreview-review |
Comment on attachment 8919432 [details]
Bug 1409446 - Properly handle out-of-band clips in the new ScrollingLayersHelper code.
https://reviewboard.mozilla.org/r/190264/#review197742
Attachment #8919432 -
Flags: review?(mstange) → review+
Comment 26•7 years ago
|
||
mozreview-review |
Comment on attachment 8919433 [details]
Bug 1409446 - Deal with scenario of two interchangeable DisplayItemClipChain objects causing a cache miss.
https://reviewboard.mozilla.org/r/190266/#review197744
Attachment #8919433 -
Flags: review?(mstange) → review+
Comment 27•7 years ago
|
||
mozreview-review |
Comment on attachment 8919434 [details]
Bug 1409446 - Work around the dual-ancestor case that WR doesn't handle yet.
https://reviewboard.mozilla.org/r/190268/#review197746
Attachment #8919434 -
Flags: review?(mstange) → review+
Comment 28•7 years ago
|
||
mozreview-review |
Comment on attachment 8919435 [details]
Bug 1409446 - Handle nested display item scenarios.
https://reviewboard.mozilla.org/r/190270/#review197748
Attachment #8919435 -
Flags: review?(mstange) → review+
Comment 29•7 years ago
|
||
mozreview-review |
Comment on attachment 8919436 [details]
Bug 1409446 - Treat sticky clips as out-of-band clips.
https://reviewboard.mozilla.org/r/190272/#review197750
Attachment #8919436 -
Flags: review?(mstange) → review+
Comment 30•7 years ago
|
||
mozreview-review |
Comment on attachment 8919437 [details]
Bug 1409446 - Switch over to the new code.
https://reviewboard.mozilla.org/r/190274/#review197756
Attachment #8919437 -
Flags: review?(mstange) → review+
Comment 31•7 years ago
|
||
mozreview-review |
Comment on attachment 8919438 [details]
Bug 1409446 - Remove old code that is now unused.
https://reviewboard.mozilla.org/r/190276/#review197758
Attachment #8919438 -
Flags: review?(mstange) → review+
Comment 32•7 years ago
|
||
mozreview-review |
Comment on attachment 8919430 [details]
Bug 1409446 - Write the new recursive method to define clip chains.
https://reviewboard.mozilla.org/r/190260/#review197760
::: gfx/layers/wr/ScrollingLayersHelper.cpp:110
(Diff revision 1)
> + if (aChain && aChain->mASR == aAsr) {
> + return RecurseAndDefineClip(aItem, aAsr, aChain, aAppUnitsPerDevPixel, aStackingContext, aCache);
> + }
> + if (aAsr) {
> + return RecurseAndDefineAsr(aItem, aAsr, aChain, aAppUnitsPerDevPixel, aStackingContext, aCache);
> + }
> +
> + MOZ_ASSERT(!aChain && !aAsr);
Oops, I missed that this was calling different functions.
Assignee | ||
Comment 33•7 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #23)
> > + // These basically be collapsed down into two codepaths; one that recurses
>
> I think this is missing the word "can"
Fixed
> Especially looking at the assert below, the if statements seem a bit
> verbose. It seems the "return RecourseAndDefineClip(...)" could just happen
> inside a single if (aChain || aAsr) {...}. Or did you do it the way you did
> it to stay closer to the comment above?
Different functions, but also yes, I wanted to keep the structure of the code closer to the comment so that it would be easier to follow.
(In reply to Markus Stange [:mstange] from comment #24)
> I'm a bit unhappy about the layering violation where renderers now need to
> know about nsDisplayItem, but I don't have any good ideas for how to avoid
> that.
Ah, I didn't even realize it was a layering violation, thanks for pointing that out. Technically the only thing I need is the clipchain which I could pass as a void* if we really want to avoid abuse of the nsDisplayItem*. I can't think of any other ways to avoid this either.
> ::: gfx/webrender_bindings/WebRenderAPI.h:432
> > + // use it's clip cache as-is. Instead, any time ScrollingLayersHelper wants
>
> it's -> its
Fixed.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 46•7 years ago
|
||
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/793acbd73126
Wire up the DefineClip and DefineScrollLayer APIs to allow specifying ancestry. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/4ae5fc22aecf
Remove unused function. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/b1465f5c3f35
Unify the clip stack in WebRenderAPI. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/408acda8e5e5
Write the new recursive method to define clip chains. r=mstange
https://hg.mozilla.org/integration/autoland/rev/75e3a4777a7f
Modify the extra-clip flag to instead track more useful information. r=ethlin,mstange
https://hg.mozilla.org/integration/autoland/rev/15f491515ba6
Properly handle out-of-band clips in the new ScrollingLayersHelper code. r=mstange
https://hg.mozilla.org/integration/autoland/rev/40c84480b4d4
Deal with scenario of two interchangeable DisplayItemClipChain objects causing a cache miss. r=mstange
https://hg.mozilla.org/integration/autoland/rev/4a1434cdcae3
Work around the dual-ancestor case that WR doesn't handle yet. r=mstange
https://hg.mozilla.org/integration/autoland/rev/debf2683f01f
Handle nested display item scenarios. r=mstange
https://hg.mozilla.org/integration/autoland/rev/4d8523e88330
Treat sticky clips as out-of-band clips. r=ethlin,mstange
https://hg.mozilla.org/integration/autoland/rev/53894a33da8c
Switch over to the new code. r=mstange
https://hg.mozilla.org/integration/autoland/rev/e036a5afa854
Remove old code that is now unused. r=mstange
Comment 47•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/793acbd73126
https://hg.mozilla.org/mozilla-central/rev/4ae5fc22aecf
https://hg.mozilla.org/mozilla-central/rev/b1465f5c3f35
https://hg.mozilla.org/mozilla-central/rev/408acda8e5e5
https://hg.mozilla.org/mozilla-central/rev/75e3a4777a7f
https://hg.mozilla.org/mozilla-central/rev/15f491515ba6
https://hg.mozilla.org/mozilla-central/rev/40c84480b4d4
https://hg.mozilla.org/mozilla-central/rev/4a1434cdcae3
https://hg.mozilla.org/mozilla-central/rev/debf2683f01f
https://hg.mozilla.org/mozilla-central/rev/4d8523e88330
https://hg.mozilla.org/mozilla-central/rev/53894a33da8c
https://hg.mozilla.org/mozilla-central/rev/e036a5afa854
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•