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

Unified Diff: Source/platform/image-encoders/skia/WEBPImageEncoder.cpp

Issue 645333002: [Android] ImageBuffer toDataURL("image/webp") has RGBA pixel input (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-encoders/skia/WEBPImageEncoder.cpp
diff --git a/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp b/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp
index e52a6848809ed6e893f09811758ac0ee9f77cc00..77ddb612fdafd5bd4e7bf076ac83a10c6d295254 100644
--- a/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp
+++ b/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp
@@ -100,8 +100,13 @@ static bool encodePixels(IntSize imageSize, const unsigned char* pixels, bool pr
return false;
picture.height = imageSize.height();
+#if SK_B32_SHIFT // Little-endian RGBA pixels. (Android)
+ if (premultiplied && !importPictureRGBX<true>(pixels, &picture))
+ return false;
+#else
if (premultiplied && !importPictureBGRX<true>(pixels, &picture))
return false;
+#endif
if (!premultiplied && !importPictureRGBX<false>(pixels, &picture))
skal 2014/10/11 13:53:53 the logic is hard to follow as written. Would be b
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698