Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: src/images/SkImageDecoder_libwebp.cpp

Issue 105443005: Fix Red/Blue decoding problem in WebP. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase correctly Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libwebp.cpp
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp
index ab58aef135baa4ae6b4c0bae267e3b4fb7d42199..4a5951020efd3d35289d23b7d3c496ee1b0517e7 100644
--- a/src/images/SkImageDecoder_libwebp.cpp
+++ b/src/images/SkImageDecoder_libwebp.cpp
@@ -173,7 +173,13 @@ static WEBP_CSP_MODE webp_decode_mode(const SkBitmap* decodedBitmap, bool premul
SkBitmap::Config config = decodedBitmap->config();
if (config == SkBitmap::kARGB_8888_Config) {
- mode = premultiply ? MODE_rgbA : MODE_RGBA;
+ #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
+ mode = premultiply ? MODE_bgrA : MODE_BGRA;
+ #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
+ mode = premultiply ? MODE_rgbA : MODE_RGBA;
+ #else
+ #error "Skia uses BGRA or RGBA byte order"
+ #endif
} else if (config == SkBitmap::kARGB_4444_Config) {
mode = premultiply ? MODE_rgbA_4444 : MODE_RGBA_4444;
} else if (config == SkBitmap::kRGB_565_Config) {
« no previous file with comments | « no previous file | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698