Closed Bug 1600356 Opened 4 years ago Closed 4 years ago

Streamline Touch Bar image loading

Categories

(Core :: Widget: Cocoa, enhancement)

enhancement
Not set
normal
Points:
5

Tracking

()

RESOLVED FIXED
mozilla73
Iteration:
73.2 - Dec 16 - Jan 5
Tracking Status
firefox73 --- disabled
firefox74 --- fixed

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.

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.

Attachment #9112613 - Attachment description: Bug 1600356 - Streamline Touch Bar image loading. r?spohl → Bug 1600356 - Part 3 - Streamline Touch Bar image loading. r?spohl
Iteration: 72.3 - Nov 18 - Dec 1 → 73.1 - Dec 2 - Dec 15
Points: 3 → 5
Blocks: touchbar
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
Iteration: 73.1 - Dec 2 - Dec 15 → 73.2 - Dec 16 - Jan 5
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73

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

Regressions: 1607140
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: