Load macOS icons with dual representations
Categories
(Core :: Widget: Cocoa, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: harry, Assigned: harry)
Details
Attachments
(1 file)
Currently, some icons on macOS load with nsCocoaUtils::CreateNSImageFromImageContainer
, which takes a CGFloat scaleFactor
parameter. The work in bug 1465403 introduced nsCocoaUtils::CreateDualRepresentationNSImageFromImageContainer
which loads an NSImage*
with both 1x and 2x representations. We should migrate our macOS icon loading code to use this new method to better support users moving between HiDPI and regular displays (for instance, a Retina MacBook connected to a 1x external monitor).
Assignee | ||
Comment 1•1 year ago
|
||
There are two places in-tree that use nsCocoaUtils::CreateNSImageFromImageContainer
: loading cursors, and loading images in Notification Center. Looking into this more, I think only the notification center call needs to be changed. The cursor is constantly reset as it moves, calling BackingScaleFactor()
to determine if a 1x or 2x cursor should be used. This is preferable to using CreateDualRepresentationNSImageFromImageContainer
since the mouse will only be on one screen at any given time.
As best I can tell, Notification Center forces loading images @1x only because CreateNSImageFromImageContainer
added a scaleFactor
parameter right before the notification center patch was about to land, so forcing 1.0f
scaling was just a stopgap taken to avoid refactoring that patch. That is, CreateDualRepresentationNSImageFromImageContainer
is a better choice there.
Assignee | ||
Comment 2•1 year ago
|
||
Pushed by htwyford@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2541bc7ccddd Load notification center icons with dual representations. r=mstange
Comment 4•1 year ago
|
||
bugherder |
Description
•