Lazy SKP image decoding in DM.

@sugoi:
Early out to avoid some segfaults in SkImageDecoder_libjpeg.cpp.
I am just flailing here... things seem to work, but I have no idea why.
This prints out a lot:
    libjpeg error 85 <End Of Image> from output_raw_data [0 0]

@halcanary:
I'm skipping on ImageSrc for now.  Leon's refactoring that quite a lot.

This causes minor diffs for the GPU backend, given that we're now
going through the YUV path.  It also reduced peak RAM usage on
my desktop from 1.26GB to 1.08GB.

BUG=skia:

Review URL: https://codereview.chromium.org/1010983004
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 06e1fe7..77131eb 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -9,8 +9,10 @@
 #include "SamplePipeControllers.h"
 #include "SkCommonFlags.h"
 #include "SkCodec.h"
+#include "SkData.h"
 #include "SkDocument.h"
 #include "SkError.h"
+#include "SkImageGenerator.h"
 #include "SkMultiPictureDraw.h"
 #include "SkNullCanvas.h"
 #include "SkOSFile.h"
@@ -21,6 +23,11 @@
 #include "SkStream.h"
 #include "SkXMLWriter.h"
 
+static bool lazy_decode_bitmap(const void* src, size_t size, SkBitmap* dst) {
+    SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, size));
+    return encoded && SkInstallDiscardablePixelRef(encoded, dst);
+}
+
 namespace DM {
 
 GMSrc::GMSrc(skiagm::GMRegistry::Factory factory) : fFactory(factory) {}
@@ -207,7 +214,7 @@
     if (!stream) {
         return SkStringPrintf("Couldn't read %s.", fPath.c_str());
     }
-    SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream));
+    SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream, &lazy_decode_bitmap));
     if (!pic) {
         return SkStringPrintf("Couldn't decode %s as a picture.", fPath.c_str());
     }
@@ -507,7 +514,7 @@
     SkDynamicMemoryWStream wStream;
     pic->serialize(&wStream);
     SkAutoTDelete<SkStream> rStream(wStream.detachAsStream());
-    SkAutoTUnref<SkPicture> deserialized(SkPicture::CreateFromStream(rStream));
+    SkAutoTUnref<SkPicture> deserialized(SkPicture::CreateFromStream(rStream, &lazy_decode_bitmap));
 
     // Turn that deserialized picture into a Src, draw it into our Sink to fill bitmap or stream.
     struct ProxySrc : public Src {