Closed Bug 548712 Opened 15 years ago Closed 15 years ago

optimize Mac OS X native menu image code

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: jaas)

Details

Attachments

(1 file)

Attached patch fix v1.0Splinter 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 on attachment 429039 [details] [diff] [review] fix v1.0 Looks fine to me.
Attachment #429039 - Flags: review?(smichaud) → review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
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.

Attachment

General

Creator:
Created:
Updated:
Size: