| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 /** | 138 /** |
| 139 * If the stream was previously read, attempt to rewind. | 139 * If the stream was previously read, attempt to rewind. |
| 140 * @returns: | 140 * @returns: |
| 141 * true | 141 * true |
| 142 * - if the stream needed to be rewound, and the rewind | 142 * - if the stream needed to be rewound, and the rewind |
| 143 * succeeded. | 143 * succeeded. |
| 144 * - if the stream did not need to be rewound. | 144 * - if the stream did not need to be rewound. |
| 145 * false | 145 * false |
| 146 * - if the stream needed to be rewound, and rewind failed. | 146 * - if the stream needed to be rewound, and rewind failed. |
| 147 * @param didTryToRewind iff non-NULL, will be set. |
| 148 * |
| 147 * Subclasses MUST call this function before reading the stream (e.g. in | 149 * Subclasses MUST call this function before reading the stream (e.g. in |
| 148 * onGetPixels). If it returns false, onGetPixels should return | 150 * onGetPixels). If it returns false, onGetPixels should return |
| 149 * kCouldNotRewind. | 151 * kCouldNotRewind. |
| 150 */ | 152 */ |
| 151 bool SK_WARN_UNUSED_RESULT rewindIfNeeded(); | 153 bool SK_WARN_UNUSED_RESULT rewindIfNeeded(bool* didTryToRewind = NULL); |
| 152 | 154 |
| 153 /* | 155 /* |
| 154 * | 156 * |
| 155 * Get method for the input stream | 157 * Get method for the input stream |
| 156 * | 158 * |
| 157 */ | 159 */ |
| 158 SkStream* stream() { | 160 SkStream* stream() { |
| 159 return fStream.get(); | 161 return fStream.get(); |
| 160 } | 162 } |
| 161 | 163 |
| 162 private: | 164 private: |
| 163 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO | 165 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO |
| 164 const SkImageInfo fInfo; | 166 const SkImageInfo fInfo; |
| 165 #endif // SK_SUPPORT_LEGACY_BOOL_ONGETINFO | 167 #endif // SK_SUPPORT_LEGACY_BOOL_ONGETINFO |
| 166 SkAutoTDelete<SkStream> fStream; | 168 SkAutoTDelete<SkStream> fStream; |
| 167 bool fNeedsRewind; | 169 bool fNeedsRewind; |
| 168 SkAutoTDelete<SkScanlineDecoder> fScanlineDecoder; | 170 SkAutoTDelete<SkScanlineDecoder> fScanlineDecoder; |
| 169 | 171 |
| 170 typedef SkImageGenerator INHERITED; | 172 typedef SkImageGenerator INHERITED; |
| 171 }; | 173 }; |
| 172 #endif // SkCodec_DEFINED | 174 #endif // SkCodec_DEFINED |
| OLD | NEW |