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

Side by Side Diff: src/codec/SkCodec.cpp

Issue 1050893002: SkCodec::onGetScanlineDecoder must call rewind. (Closed) Base URL: https://skia.googlesource.com/skia.git@pngRewind
Patch Set: All codecs can now rewind. Remove code to support unrewindable codecs. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkCodec_libbmp.h" 10 #include "SkCodec_libbmp.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const bool needsRewind = fNeedsRewind; 81 const bool needsRewind = fNeedsRewind;
82 fNeedsRewind = true; 82 fNeedsRewind = true;
83 if (!needsRewind) { 83 if (!needsRewind) {
84 return kNoRewindNecessary_RewindState; 84 return kNoRewindNecessary_RewindState;
85 } 85 }
86 return fStream->rewind() ? kRewound_RewindState 86 return fStream->rewind() ? kRewound_RewindState
87 : kCouldNotRewind_RewindState; 87 : kCouldNotRewind_RewindState;
88 } 88 }
89 89
90 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) { 90 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) {
91 fScanlineDecoder.reset(NULL);
92 if (!rewindIfNeeded()) {
93 return NULL;
94 }
95 fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo)); 91 fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo));
96 return fScanlineDecoder.get(); 92 return fScanlineDecoder.get();
97 } 93 }
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698