Index: content/shell/layout_test_controller_host.cc |
diff --git a/content/shell/layout_test_controller_host.cc b/content/shell/layout_test_controller_host.cc |
index 88ab1769568ef884c12b44ebcc4cf84f379d9f3e..d987809f74ba696bc0f67551f70143d727c56485 100644 |
--- a/content/shell/layout_test_controller_host.cc |
+++ b/content/shell/layout_test_controller_host.cc |
@@ -116,11 +116,6 @@ void LayoutTestControllerHost::OnTextDump(const std::string& dump) { |
void LayoutTestControllerHost::OnImageDump( |
const std::string& actual_pixel_hash, |
const SkBitmap& image) { |
-#if !defined(OS_ANDROID) |
- // DumpRenderTree is not currently supported for Android. Also, on Android |
- // the required webkit_support methods are not defined, so this method just |
- // doesn't compile. |
- |
SkAutoLockPixels image_lock(image); |
printf("\nActualHash: %s\n", actual_pixel_hash.c_str()); |
@@ -139,14 +134,27 @@ void LayoutTestControllerHost::OnImageDump( |
bool discard_transparency = true; |
#endif |
- if (webkit_support::EncodeBGRAPNGWithChecksum( |
- reinterpret_cast<const unsigned char*>(image.getPixels()), |
- image.width(), |
- image.height(), |
- static_cast<int>(image.rowBytes()), |
- discard_transparency, |
- actual_pixel_hash, |
- &png)) { |
+ bool success = false; |
+#if defined(OS_ANDROID) |
+ success = webkit_support::EncodeRGBAPNGWithChecksum( |
+ reinterpret_cast<const unsigned char*>(image.getPixels()), |
+ image.width(), |
+ image.height(), |
+ static_cast<int>(image.rowBytes()), |
+ discard_transparency, |
+ actual_pixel_hash, |
+ &png); |
+#else |
+ success = webkit_support::EncodeBGRAPNGWithChecksum( |
+ reinterpret_cast<const unsigned char*>(image.getPixels()), |
+ image.width(), |
+ image.height(), |
+ static_cast<int>(image.rowBytes()), |
+ discard_transparency, |
+ actual_pixel_hash, |
+ &png); |
+#endif |
+ if (success) { |
printf("Content-Type: image/png\n"); |
printf("Content-Length: %u\n", static_cast<unsigned>(png.size())); |
fwrite(&png[0], 1, png.size(), stdout); |
@@ -154,7 +162,6 @@ void LayoutTestControllerHost::OnImageDump( |
} |
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
-#endif |
} |
void LayoutTestControllerHost::OnNotifyDone() { |