Index: tools/pinspect.cpp |
diff --git a/tools/pinspect.cpp b/tools/pinspect.cpp |
index b5a6727e96ed51fd92b5836bf25c18ebc67f549f..aa6dd97ea9fac44ad25994d80554dd131b72a3a7 100644 |
--- a/tools/pinspect.cpp |
+++ b/tools/pinspect.cpp |
@@ -5,14 +5,18 @@ |
* found in the LICENSE file. |
*/ |
- |
#include "SkBitmap.h" |
#include "SkCanvas.h" |
+#include "SkGraphics.h" |
#include "SkOSFile.h" |
+#include "SkImageDecoder.h" |
#include "SkPicture.h" |
#include "SkStream.h" |
#include "SkString.h" |
#include "SkDumpCanvas.h" |
+#include "SkForceLinking.h" |
+ |
+__SK_FORCE_IMAGE_DECODER_LINKING; |
static SkPicture* inspect(const char path[]) { |
SkFILEStream stream(path); |
@@ -33,7 +37,12 @@ static SkPicture* inspect(const char path[]) { |
} |
stream.rewind(); |
- SkPicture* pic = SkNEW_ARGS(SkPicture, (&stream)); |
+ bool success = false; |
+ SkPicture* pic = SkNEW_ARGS(SkPicture, (&stream, &success, &SkImageDecoder::DecodeMemory)); |
+ if (!success) { |
+ SkDebugf("Could not create SkPicture"); |
caryclark
2013/06/12 12:03:11
include the path that failed in the printf, and te
sglez
2013/06/12 15:37:36
Done.
|
+ return pic; |
+ } |
printf("picture size:[%d %d]\n", pic->width(), pic->height()); |
return pic; |
} |
@@ -50,6 +59,7 @@ static void dumpOps(SkPicture* pic) { |
int tool_main(int argc, char** argv); |
int tool_main(int argc, char** argv) { |
+ SkAutoGraphics ag; |
if (argc < 2) { |
printf("Usage: pinspect [--dump-ops] filename [filename ...]\n"); |
return 1; |