Bug 53949 - ImageDecoder.h hardcodes RGBA byteorder on Skia
Summary: ImageDecoder.h hardcodes RGBA byteorder on Skia
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-07 14:56 PST by George Wright
Modified: 2011-02-08 09:17 PST (History)
4 users (show)

See Also:


Attachments
Use SkPackARGB32 in Skia's case (1.83 KB, patch)
2011-02-07 15:00 PST, George Wright
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Wright 2011-02-07 14:56:34 PST
At the moment the setRGBA function in ImageDecoder.h hard codes the colour byte order:

*dest = (a << 24 | r << 16 | g << 8 | b);

In Skia's case this should use Skia's helper function SkPackARGB32.
Comment 1 George Wright 2011-02-07 15:00:13 PST
Created attachment 81531 [details]
Use SkPackARGB32 in Skia's case

Patch to use SkPackARGB32 in Skia's case.
Comment 2 Eric Seidel (no email) 2011-02-07 15:07:11 PST
I'm confused why this needs to be in a shared file.
Comment 3 Peter Kasting 2011-02-07 15:09:41 PST
This looks OK to me.

(In reply to comment #2)
> I'm confused why this needs to be in a shared file.

It needs to be inlined into all the decoders.
Comment 4 Adam Barth 2011-02-07 16:00:12 PST
Comment on attachment 81531 [details]
Use SkPackARGB32 in Skia's case

This change is fine, but it illustrates some of the design problems with this class.
Comment 5 Patrick R. Gansterer 2011-02-08 07:44:15 PST
Comment on attachment 81531 [details]
Use SkPackARGB32 in Skia's case

cq+ as requested by gw280 on IRC
Comment 6 WebKit Commit Bot 2011-02-08 09:15:52 PST
The commit-queue encountered the following flaky tests while processing attachment 81531 [details]:

http/tests/websocket/tests/error-detect.html bug 54012 (author: abarth@webkit.org)
The commit-queue is continuing to process your patch.
Comment 7 WebKit Commit Bot 2011-02-08 09:17:04 PST
Comment on attachment 81531 [details]
Use SkPackARGB32 in Skia's case

Clearing flags on attachment: 81531

Committed r77946: <http://trac.webkit.org/changeset/77946>
Comment 8 WebKit Commit Bot 2011-02-08 09:17:09 PST
All reviewed patches have been landed.  Closing bug.