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

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: Fix bug in transferBuffer. 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..f6d2da6e432b52b4de323d93e905cf83d8d981a2 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,14 @@ SkCodec* SkCodec::NewFromStream(SkStream* stream,
break;
}
}
+
+#ifdef SK_CODEC_DECODES_RAW
+ // Try to treat the input as RAW if all the other checks failed.
+ if (streamDeleter) {
scroggo 2016/01/20 19:47:16 When you rebase, we have removed the variable "cod
yujieqin 2016/01/20 21:46:45 Sorry, as I am not really using git before, I have
yujieqin 2016/01/21 16:40:01 Thanks for the tips. I got the code rebase and fix
+ SkASSERT(!codec);
+ 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