Refactor display item building so that building function knows the item index beforehand
Categories
(Core :: Web Painting, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: mikokm, Assigned: mikokm)
References
(Blocks 1 open bug)
Details
Attachments
(17 files, 5 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Currently display items have their index passed in as an arbitrary positioned constructor parameter. This index is then returned by CalculatePerFrameKey()
, and MakeDisplayItem()
uses it and the display item type to construct the per frame key for the display item.
This hack makes it difficult to implement the reuse of display items that can have index (= display item types that frame can have more than one of). We should refactor the display item creation, so that the callers requiring items with index need to pass it more explicitly.
Comment 1•5 years ago
|
||
My suggestion for this is to take the per-type logic within the virtual CalculatePerFrameKey, and move it to the static per-type callsites of MakeDisplayItem(or AppendToTop). Most item types only have one creation site, so this shouldn't result in much duplication, and we can add static helper functions as needed.
We'll probably also want a second variation of MakeDisplayItem that takes the computed index (MakeDisplayItemWithIndex?) so that we don't need to touch the callsites of items that aren't affected by this change.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
This static method is assumed to have the same signature as the type's constructor,
and so we must have an implementation of ComputePerFrameKey for each constructor
a display item provides that is called by MakeDisplayItem. Notably this excludes
the MakeClone constructor for a lot of items.
There is a default varargs implementation on nsDisplayItem which everyone
inherits by default, so types which previously didn't overload this method
still don't need to.
Providing an implementation of ComputePerFrameKey on some display item type
shadows the varargs implementation, so one doesn't need to worry about overloading
one constructor but forgetting about another -- if you do, the compiler will only
see the overload and complain that the signature doesn't match.
One slightly annoying result of this is that display items which previously
inherited an overloaded implementation from a superclass now must provide
their own manual implementations. Although as far as I could tell, all of
those cases had a trivial implementation of key=0 (the super class supported
custom keys but the subclasses didn't make use of it).
In those cases I just hardcoded key=0, but it's possible that it would be
better to call into the superclass' implementation to be more robust to changes.
Comment 3•5 years ago
|
||
This distinguishes better between the overloaded aspect of the PerFrameKey and the
actual mixed value.
Comment 5•5 years ago
|
||
Backed out 2 changesets (Bug 1554499) for mochitest failures at test_restyles.html.
Backout: https://hg.mozilla.org/integration/autoland/rev/5fceb8c496bfe98c1081d9ff8712e9107dd22767
Push that started the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Csuccess%2Ctestfailed%2Cbusted%2Cexception&revision=1a6a6a38c9877b47da1cbb81449fc15d8e4afb87&selectedJob=257212351
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=257212351&repo=autoland&lineNumber=7483
Comment 6•5 years ago
|
||
Hi Alexis, your patches also turned bug 1512068 into a permafailure:
Comment 8•5 years ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:Gankro, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 9•5 years ago
|
||
this is in my queue, there's just several higher priority things in the way (unless matt or miko really need/want this to make progress soon)
Comment 10•5 years ago
|
||
Unassigning myself as there seems to perpetually be higher priority webrender bugs to look into since we started shipping more to release... :/
Assignee | ||
Comment 11•5 years ago
|
||
Depends on D37804
Assignee | ||
Comment 12•5 years ago
|
||
Depends on D50185
Assignee | ||
Comment 13•5 years ago
|
||
Depends on D50186
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/133cddb65f59
https://hg.mozilla.org/mozilla-central/rev/a49d1c9e8b14
https://hg.mozilla.org/mozilla-central/rev/f60fee484460
https://hg.mozilla.org/mozilla-central/rev/c802ab8cc730
https://hg.mozilla.org/mozilla-central/rev/3a49bec95338
Updated•5 years ago
|
Comment 16•5 years ago
|
||
Backed out for frequent crashes, at least on OS X (Bug 1594381):
https://hg.mozilla.org/mozilla-central/rev/d9daf28a5559712a8db772aa8388f444a93f4063
Crash reports:
https://crash-stats.mozilla.org/report/index/cfdad603-bf93-4920-af93-470030191106
https://crash-stats.mozilla.org/report/index/5f8b00c2-73c8-4483-87d0-c50d80191106
https://crash-stats.mozilla.org/report/index/7dbb0f6e-94cb-4717-a84c-0d3d20191106
Comment 17•5 years ago
|
||
It also seems to have caused Bug 1567274 to appear again:
https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=Windows%2C10%2Cx64%2CMinGW%2Cdebug%2CFirefox%2Cfunctional%2Ctests%2C%28local%29%2Ctest-windows10-64-mingwclang%2Fdebug-firefox-ui-functional-local-e10s%2CFxfn-l%28en-US%29&tochange=5319361284412e36acd0235d85cfa25149bc9a67&group_state=expanded&fromchange=082bcb14a8c5796ea53715de00b37852f9d45b35&selectedJob=274827079
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 19•5 years ago
|
||
Assigning this to miko since he's working on this and not me.
Assignee | ||
Comment 20•5 years ago
|
||
Assignee | ||
Comment 21•5 years ago
|
||
Depends on D74080
Assignee | ||
Comment 22•5 years ago
|
||
This clarifies that mPerFrameIndex is just a part of the key returned by GetPerFrameKey().
Depends on D74081
Assignee | ||
Comment 23•5 years ago
|
||
Depends on D74082
Assignee | ||
Comment 24•5 years ago
|
||
Depends on D74083
Assignee | ||
Comment 25•5 years ago
|
||
Depends on D74084
Assignee | ||
Comment 26•5 years ago
|
||
Depends on D74085
Assignee | ||
Comment 27•5 years ago
|
||
Depends on D74086
Assignee | ||
Comment 28•5 years ago
|
||
Depends on D74087
Assignee | ||
Comment 29•5 years ago
|
||
Depends on D74088
Assignee | ||
Comment 30•5 years ago
|
||
Depends on D74089
Assignee | ||
Comment 31•5 years ago
|
||
Depends on D74090
Assignee | ||
Comment 32•5 years ago
|
||
Depends on D74091
Assignee | ||
Comment 33•5 years ago
|
||
Depends on D74092
Assignee | ||
Comment 34•5 years ago
|
||
Depends on D74093
Assignee | ||
Comment 35•5 years ago
|
||
Depends on D74094
Assignee | ||
Comment 36•5 years ago
|
||
Depends on D74095
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 37•5 years ago
|
||
Comment 38•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fe5dc2700bbe
https://hg.mozilla.org/mozilla-central/rev/e8af75b90320
https://hg.mozilla.org/mozilla-central/rev/fba736154f5f
https://hg.mozilla.org/mozilla-central/rev/2a5158285cd5
https://hg.mozilla.org/mozilla-central/rev/cd01a403c04d
https://hg.mozilla.org/mozilla-central/rev/75651ced7904
https://hg.mozilla.org/mozilla-central/rev/3986b6f09e62
https://hg.mozilla.org/mozilla-central/rev/3fcba0495040
https://hg.mozilla.org/mozilla-central/rev/a6d9f235d7bb
https://hg.mozilla.org/mozilla-central/rev/e75e94d2c712
https://hg.mozilla.org/mozilla-central/rev/af84a5159a44
https://hg.mozilla.org/mozilla-central/rev/9cd738ed8e4f
https://hg.mozilla.org/mozilla-central/rev/24885f67361f
https://hg.mozilla.org/mozilla-central/rev/18a3148eff4b
https://hg.mozilla.org/mozilla-central/rev/7f0a11b398ce
https://hg.mozilla.org/mozilla-central/rev/5f9b5f39ff69
https://hg.mozilla.org/mozilla-central/rev/22b375ad5f36
Description
•