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

Side by Side Diff: include/codec/SkCodec.h

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 | « no previous file | src/codec/SkCodec.cpp » ('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 #ifndef SkCodec_DEFINED 8 #ifndef SkCodec_DEFINED
9 #define SkCodec_DEFINED 9 #define SkCodec_DEFINED
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 #else 114 #else
115 return this->getInfo().dimensions(); 115 return this->getInfo().dimensions();
116 #endif 116 #endif
117 } 117 }
118 118
119 virtual SkEncodedFormat onGetEncodedFormat() const = 0; 119 virtual SkEncodedFormat onGetEncodedFormat() const = 0;
120 120
121 /** 121 /**
122 * Override if your codec supports scanline decoding. 122 * Override if your codec supports scanline decoding.
123 * 123 *
124 * No need to call rewindIfNeeded(), which will have already been called 124 * As in onGetPixels(), the implementation must call rewindIfNeeded() and
125 * by the base class. 125 * handle as appropriate.
126 * 126 *
127 * @param dstInfo Info of the destination. If the dimensions do not match 127 * @param dstInfo Info of the destination. If the dimensions do not match
128 * those of getInfo, this implies a scale. 128 * those of getInfo, this implies a scale.
129 * @return New SkScanlineDecoder on success, NULL otherwise. The SkCodec 129 * @return New SkScanlineDecoder on success, NULL otherwise. The SkCodec
130 * will take ownership of the returned scanline decoder. 130 * will take ownership of the returned scanline decoder.
131 */ 131 */
132 virtual SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo) { 132 virtual SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo) {
133 return NULL; 133 return NULL;
134 } 134 }
135 135
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO 169 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO
170 const SkImageInfo fInfo; 170 const SkImageInfo fInfo;
171 #endif // SK_SUPPORT_LEGACY_BOOL_ONGETINFO 171 #endif // SK_SUPPORT_LEGACY_BOOL_ONGETINFO
172 SkAutoTDelete<SkStream> fStream; 172 SkAutoTDelete<SkStream> fStream;
173 bool fNeedsRewind; 173 bool fNeedsRewind;
174 SkAutoTDelete<SkScanlineDecoder> fScanlineDecoder; 174 SkAutoTDelete<SkScanlineDecoder> fScanlineDecoder;
175 175
176 typedef SkImageGenerator INHERITED; 176 typedef SkImageGenerator INHERITED;
177 }; 177 };
178 #endif // SkCodec_DEFINED 178 #endif // SkCodec_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698