Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: src/codec/SkCodec.cpp

Issue 1520403003: Prototype of RAW decoding in Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Implement SkRawStream. Fixed new comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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).

Powered by Google App Engine
This is Rietveld 408576698