Closed
Bug 327580
Opened 20 years ago
Closed 20 years ago
fix image decoder endianness/RGB issues
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: vlad, Assigned: vlad)
References
Details
Attachments
(1 file, 1 obsolete file)
|
18.84 KB,
patch
|
pavlov
:
review+
|
Details | Diff | Splinter Review |
We've had some hacks in the decoder/image code that fell apart once we started building on mac, with both big and little endian support. Need to formalize the contract that all data going in to nsThebesImage is to be in R G B order.
Later on we should look at converting the image decoders to just output ARGB directly.
| Assignee | ||
Comment 1•20 years ago
|
||
Patch fix. Forces all decoders to give us RGB data if MOZ_CAIRO_GFX, and then we assemble that data into a dword based on the current endianness.
Attachment #212185 -
Flags: review?(pavlov)
| Assignee | ||
Comment 2•20 years ago
|
||
Er, ignore the two Paint/Fill hunks in there, typo.
Comment 3•20 years ago
|
||
Comment on attachment 212185 [details] [diff] [review]
fix image decoder rgb order & endianness
+ // Output is always ARGB with A in the high byte of a dword
+#ifdef IS_LITTLE_ENDIAN
return (aAlpha << 24) | (r << 16) | (g << 8) | b;
+#else
+ return (b << 24) | (g << 16) | (r << 8) | aAlpha;
+#endif
but, this doesn't always put it in the high byte. you put it in the low byte on bit-endian platforms. isn't that wrong?
| Assignee | ||
Comment 4•20 years ago
|
||
Er, yes. Good catch, I had my mind going crazy last night trying to figure out who was swapping where.. I'll fix that and test on OSX/PPC over the weekend.
| Assignee | ||
Comment 5•20 years ago
|
||
Updated patch; tested on win32, intel mac, ppc mac.
Attachment #212185 -
Attachment is obsolete: true
Attachment #212648 -
Flags: review?(pavlov)
Attachment #212185 -
Flags: review?(pavlov)
Updated•20 years ago
|
Attachment #212648 -
Flags: review?(pavlov) → review+
| Assignee | ||
Updated•20 years ago
|
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Assignee: nobody → vladimir
You need to log in
before you can comment on or make changes to this bug.
Description
•