Closed
Bug 393336
Opened 18 years ago
Closed 18 years ago
Don't do ARGB->RGBA translation in nsClipboard.mm
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: cbarrett, Assigned: bugzilla)
Details
Attachments
(1 file, 3 obsolete files)
4.88 KB,
patch
|
cbarrett
:
review+
jaas
:
review+
mikepinkerton
:
superreview+
pavlov
:
approval1.9+
|
Details | Diff | Splinter Review |
Now that we don't support 10.3, we should get rid of the ARGB->RGBA code in nsClipboard.mm. Instead we should pass bitmapFormat:NSAlphaFirstBitmapFormat as one of the arguments to initWithBitmapDataPlanes...
http://mxr.mozilla.org/seamonkey/source/widget/src/cocoa/nsClipboard.mm#351
Assignee | ||
Comment 1•18 years ago
|
||
Proposed fix.
Gets rid of all the reorderedData code and just calls initWithBitmapDataPlanes with the bitmapFormat argument.
Attachment #278033 -
Flags: review?(cbarrett)
Reporter | ||
Comment 2•18 years ago
|
||
Comment on attachment 278033 [details] [diff] [review]
fix
>- planes[0] = (PRUint8*)reorderedData;
>+ planes[0] = image->GetBits();
> planes[1] = nsnull;
> isPlanar:NO
Since the data isn't planar, we don't need a null terminating plane either.
Other than that looks fine.
Attachment #278033 -
Flags: review?(cbarrett) → review-
Assignee | ||
Comment 3•18 years ago
|
||
New fix incorporating the change in the above comment as well.
Attachment #278033 -
Attachment is obsolete: true
Attachment #278110 -
Flags: review?(cbarrett)
Reporter | ||
Updated•18 years ago
|
Attachment #278110 -
Flags: superreview?(roc)
Attachment #278110 -
Flags: review?(cbarrett)
Attachment #278110 -
Flags: review+
Reporter | ||
Updated•18 years ago
|
Assignee: cbarrett → bugzilla
Attachment #278110 -
Flags: superreview?(roc) → superreview+
Reporter | ||
Comment 4•18 years ago
|
||
Ergh, when doing pre-checkin sanity tests, I noticed that on my little endian machine, this doesn't work right. Seems NSBitmapImageFormat doesn't respect the native architecture and forces big-endian? Ugh.
Reporter | ||
Comment 5•18 years ago
|
||
Comment on attachment 278110 [details] [diff] [review]
fix v2
marking the patch r- so nobody drive-by checkins it.
Attachment #278110 -
Flags: review+ → review-
Assignee | ||
Comment 6•18 years ago
|
||
New fix that copies the image data directly into the bitmapData of the NSBitmapImageRep. Works on my PPC, and hopefully it'll work on a little-endian Intel machine too.
Attachment #278110 -
Attachment is obsolete: true
Attachment #278160 -
Flags: review?(cbarrett)
Assignee | ||
Comment 7•18 years ago
|
||
This one actually works on one PPC machine and one Intel machine.
I chucked NSBitmapRep entirely and instead use Quartz functions to convert the image to TIFF for the pasteboard. CGImageCreate takes endianness into account, solving the architecture problem.
Attachment #278160 -
Attachment is obsolete: true
Attachment #278191 -
Flags: review?(cbarrett)
Attachment #278160 -
Flags: review?(cbarrett)
Reporter | ||
Comment 8•18 years ago
|
||
Comment on attachment 278191 [details] [diff] [review]
fix v4
looks good, tested it here, seems to work fine. Tried loading large images from NASA (5MB or so), no noticeable beachballing.
Attachment #278191 -
Flags: superreview?(roc)
Attachment #278191 -
Flags: review?(cbarrett)
Attachment #278191 -
Flags: review+
Comment on attachment 278191 [details] [diff] [review]
fix v4
I want to look too before this lands, but go ahead with sr.
Attachment #278191 -
Flags: review?(joshmoz)
Reporter | ||
Comment 10•18 years ago
|
||
ah sure, that's fine. Probably should have requested r from you anyway, given that I'm not an actual peer.
Comment 11•18 years ago
|
||
Comment on attachment 278191 [details] [diff] [review]
fix v4
+ [pasteboardOutputDict setObject:(NSMutableData *)tiffData forKey:NSTIFFPboardType];
No space between "NSMutableData" and the "*". Just fix that on checkin.
Attachment #278191 -
Flags: review?(joshmoz) → review+
Attachment #278191 -
Flags: superreview?(roc) → superreview?(pavlov)
Attachment #278191 -
Flags: superreview?(pavlov) → superreview?(mikepinkerton)
Comment 12•18 years ago
|
||
Comment on attachment 278191 [details] [diff] [review]
fix v4
sr=pink
Attachment #278191 -
Flags: superreview?(mikepinkerton) → superreview+
Attachment #278191 -
Flags: approval1.9?
Updated•18 years ago
|
Attachment #278191 -
Flags: approval1.9? → approval1.9+
Comment 13•18 years ago
|
||
landed on trunk, thanks 'Ili!
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•