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

Unified Diff: src/codec/SkWebpCodec.cpp

Issue 1288483002: Consolidate SkCodec functions for handling rewind (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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
« src/codec/SkBmpCodec.h ('K') | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkWebpCodec.cpp
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index 041bfb6b63aa191443805a702adc8263ec2e1b3a..624ff74fa0af86e24bc1aa6fa0a38938d21b3232 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -153,16 +153,8 @@ bool SkWebpCodec::onGetValidSubset(SkIRect* desiredSubset) const {
SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t rowBytes,
const Options& options, SkPMColor*, int*) {
- switch (this->rewindIfNeeded()) {
- case kCouldNotRewind_RewindState:
- return kCouldNotRewind;
- case kRewound_RewindState:
- // Rewound to the beginning. Since creation only does a peek, the stream is at the
- // correct position.
- break;
- case kNoRewindNecessary_RewindState:
- // Already at the right spot for decoding.
- break;
+ if (!this->rewindIfNeeded()) {
+ return kCouldNotRewind;
}
if (!conversion_possible(dstInfo, this->getInfo())) {
« src/codec/SkBmpCodec.h ('K') | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698