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) { |