OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |