Add input/output image logging to processor tests

Moves SkBitmap to base64 uri code into test utils

Bug: skia:
Change-Id: I4f92761fd2e643c38ed00a200b1cb62778a85948
Reviewed-on: https://skia-review.googlesource.com/158340
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/tests/TestUtils.h b/tests/TestUtils.h
index e891931..5fc9afd 100644
--- a/tests/TestUtils.h
+++ b/tests/TestUtils.h
@@ -6,6 +6,7 @@
  */
 
 #include "Test.h"
+#include "SkBitmap.h"
 
 class GrSurfaceContext;
 class GrSurfaceProxy;
@@ -37,3 +38,7 @@
 // Checks srcBuffer and dstBuffer contain the same colors
 bool does_full_buffer_contain_correct_color(GrColor* srcBuffer, GrColor* dstBuffer, int width,
                                             int height);
+
+// Encodes the bitmap into a data:/image/png;base64,... url suitable to view in a browser after
+// printing to a log. If false is returned, dst holds an error message instead of a URI.
+bool bitmap_to_base64_data_uri(const SkBitmap& bitmap, SkString* dst);