Closed
Bug 548712
Opened 15 years ago
Closed 15 years ago
optimize Mac OS X native menu image code
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jaas, Assigned: jaas)
Details
Attachments
(1 file)
4.67 KB,
patch
|
smichaud
:
review+
|
Details | Diff | Splinter Review |
There are some optimizations we can make to the code that creates images for Mac OS X native menus.
* Avoid unnecessary endian swaps
* Avoid unnecessary ARGB->RGBA conversion
* Avoid unnecessary an unnecessary malloc and image copy when we don't need a sub-image
Attachment #429039 -
Flags: review?(smichaud)
There is probably some other optimization we could do but this cleans up the worst of it I think. In Firefox the menu images tend to not require a sub-image so we do actually cut out the sub-image copy in most cases.
Comment 2•15 years ago
|
||
Comment on attachment 429039 [details] [diff] [review]
fix v1.0
Looks fine to me.
Attachment #429039 -
Flags: review?(smichaud) → review+
pushed to mozilla-central
http://hg.mozilla.org/mozilla-central/rev/9dbbcdec2199
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 4•15 years ago
|
||
I assume that there is more to optimize here, when the (sub)image is already 16x16:
498 // The image may not be the right size for a menu icon (16x16).
499 // Create a new CGImage for the menu item.
500 PRUint8* bitmap = (PRUint8*)malloc(kIconBytes);
You need to log in
before you can comment on or make changes to this bug.
Description
•