diff options
Diffstat (limited to 'webkit/tools/test_shell/mock_webclipboard_impl.cc')
-rw-r--r-- | webkit/tools/test_shell/mock_webclipboard_impl.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc index e21269a..e280e4e 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; |