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