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

Unified Diff: webkit/tools/test_shell/mock_webclipboard_impl.cc

Issue 10824366: Fix RGBA pixel layout when reading image from clipboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: webkit/tools/test_shell/mock_webclipboard_impl.cc
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc
index e21269a9fcd4ccc7742ab6c4b7b6c7ea006c187d..e280e4e89c912a20a11a9e5f690fa4c5a0fd82ca 100644
--- a/webkit/tools/test_shell/mock_webclipboard_impl.cc
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc
@@ -105,12 +105,20 @@ WebKit::WebData MockWebClipboardImpl::readImage(
// for endianess reasons, it will be BGRA8888 on Windows.
const SkBitmap& bitmap = m_image.getSkBitmap();
SkAutoLockPixels lock(bitmap);
+#if defined(OS_ANDROID)
+ webkit_support::EncodeRGBAPNG(static_cast<unsigned char*>(bitmap.getPixels()),
+ bitmap.width(),
+ bitmap.height(),
+ bitmap.rowBytes(),
+ &encoded_image);
+#else
webkit_support::EncodeBGRAPNG(static_cast<unsigned char*>(bitmap.getPixels()),
bitmap.width(),
bitmap.height(),
bitmap.rowBytes(),
false,
&encoded_image);
+#endif
data.assign(reinterpret_cast<char*>(vector_as_array(&encoded_image)),
encoded_image.size());
return data;
« 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