Streamline Touch Bar image loading
Categories
(Core :: Widget: Cocoa, enhancement)
Tracking
()
People
(Reporter: bugzilla, Assigned: bugzilla)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Currently, every instance of TouchBarInput
holds a reference to an nsIDocument
. There's also some duplication of the image-loading code in nsTouchBar.mm
. Finally, nsIconLoaderService passes the nsIDocument
to imgLoader::LoadImage
even though that isn't necessary for browser-chrome images.
I did some refactoring work when I was exploring solutions for bug 1595082 that resolves the awkwardness above. Instead of retrieving and storing a reference to nsIDocument
every time a TouchBarInput
is created, the patch just retrieves the current document from MacTouchBar.js
when images are loading. This is adequate since all the document is needed for is getting an imgLoader
which does not depend on the document after it is created. The patch also eliminates two of TouchBarInput
's many properties. I don't expect any performance gains, but the patch streamlines image loading for the Touch Bar and makes the code a little less brittle.
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
nsTouchBar.h/.mm were getting a bit unwieldy, particularly after the TouchBarInputBaseType enum from the next part of this patch was added. This part splits out TouchBarInput into its own files. This makes the Touch Bar's file structure similar to that of the menu bar's: nsMenuBarX, nsMenuBarItemX, and nsMenuBarItemIconX contrasted with nsTouchBar, nsTouchBarInput, and nsTouchBarInputIcon.
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D56589
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Pushed by htwyford@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f5e9f3a1c3e Part 1 - Split out TouchBarInput into its own files. r=spohl https://hg.mozilla.org/integration/autoland/rev/f742190493ff Part 2 - Introduce TouchBarInputBaseType enum and change signatures on TouchBarInput update methods. r=spohl https://hg.mozilla.org/integration/autoland/rev/3295c2e9b944 Part 3 - Streamline Touch Bar image loading. r=spohl
Assignee | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2f5e9f3a1c3e
https://hg.mozilla.org/mozilla-central/rev/f742190493ff
https://hg.mozilla.org/mozilla-central/rev/3295c2e9b944
Comment 6•4 years ago
|
||
backout |
Backed out from Beta along with bug 1581555 to hopefully avoid hitting bug 1607140 in 73.0b1. It remains landed on m-c for 74+.
https://hg.mozilla.org/releases/mozilla-beta/rev/ea93a9ceeea1a0b8cacb5c9038e1fa1d00e50bc6
Description
•