Index: src/codec/SkCodec.cpp |
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp |
index 87a7ded7dd6bd2e0c0a6da19de1d9782a50553c3..73c2165fe3311268194928439c6764d782804b1f 100644 |
--- a/src/codec/SkCodec.cpp |
+++ b/src/codec/SkCodec.cpp |
@@ -16,6 +16,9 @@ |
#if !defined(GOOGLE3) |
#include "SkJpegCodec.h" |
#endif |
+#ifdef SK_CODEC_DECODES_RAW |
+#include "SkRawCodec.h" |
+#endif |
#include "SkStream.h" |
#include "SkWebpCodec.h" |
@@ -85,6 +88,13 @@ SkCodec* SkCodec::NewFromStream(SkStream* stream, |
break; |
} |
} |
+ |
+ // Try to treat the input as RAW if all the other checks failed. |
+ if (!codec && streamDeleter) { |
msarett
2016/01/07 16:39:11
We check streamDeleter here because one of the oth
scroggo
2016/01/07 20:57:42
I think this is redundant.
If codec is NULL, stre
yujieqin
2016/01/08 14:00:12
msarett@, yes, we run into once this issue that ot
scroggo
2016/01/08 17:12:25
My mistake. It is possible that the first few byte
|
+#ifdef SK_CODEC_DECODES_RAW |
msarett
2016/01/07 16:39:11
nit: Can we surround the entire if statement with
yujieqin
2016/01/08 14:00:12
Done.
|
+ codec.reset(SkRawCodec::NewFromStream(streamDeleter.detach())); |
+#endif |
+ } |
} |
// Set the max size at 128 megapixels (512 MB for kN32). |