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

Unified Diff: src/codec/SkCodec.cpp

Issue 1006583005: SkCodec: add wbmp class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-27 (Friday) 10:53:14 EDT Created 5 years, 9 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
« no previous file with comments | « resources/mandrill.wbmp ('k') | src/codec/SkCodec_libbmp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec.cpp
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index a49586ffeb1ecf6ff337b1dc12fd0fe8120be113..33cc9e1c00b7d0e314cb96dbc57a87569b3bbc72 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -10,6 +10,7 @@
#include "SkCodec_libbmp.h"
#include "SkCodec_libico.h"
#include "SkCodec_libpng.h"
+#include "SkCodec_wbmp.h"
#include "SkStream.h"
struct DecoderProc {
@@ -20,7 +21,8 @@ struct DecoderProc {
static const DecoderProc gDecoderProcs[] = {
{ SkPngCodec::IsPng, SkPngCodec::NewFromStream },
{ SkIcoCodec::IsIco, SkIcoCodec::NewFromStream },
- { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream }
+ { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream },
+ { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream }
};
SkCodec* SkCodec::NewFromStream(SkStream* stream) {
@@ -56,12 +58,16 @@ SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream)
, fNeedsRewind(false)
{}
-bool SkCodec::rewindIfNeeded() {
+SkCodec::RewindState SkCodec::rewindIfNeeded() {
// Store the value of fNeedsRewind so we can update it. Next read will
// require a rewind.
- const bool neededRewind = fNeedsRewind;
+ const bool needsRewind = fNeedsRewind;
fNeedsRewind = true;
- return !neededRewind || fStream->rewind();
+ if (!needsRewind) {
+ return kNoRewindNecessary_RewindState;
+ }
+ return fStream->rewind() ? kRewound_RewindState
+ : kCouldNotRewind_RewindState;
}
SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) {
« no previous file with comments | « resources/mandrill.wbmp ('k') | src/codec/SkCodec_libbmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698