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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 virtual bool onReallyHasAlpha() const { return false; } | 396 virtual bool onReallyHasAlpha() const { return false; } |
397 | 397 |
398 /** | 398 /** |
399 * If the stream was previously read, attempt to rewind. | 399 * If the stream was previously read, attempt to rewind. |
400 * | 400 * |
401 * If the stream needed to be rewound, call onRewind. | 401 * If the stream needed to be rewound, call onRewind. |
402 * @returns true if the codec is at the right position and can be used. | 402 * @returns true if the codec is at the right position and can be used. |
403 * false if there was a failure to rewind. | 403 * false if there was a failure to rewind. |
404 * | 404 * |
405 * Subclasses MUST call this function before reading the stream (e.g. in | 405 * This is called by getPixels() and start(). Subclasses may call if they |
406 * onGetPixels). If it returns false, onGetPixels should return | 406 * need to rewind at another time. |
407 * kCouldNotRewind. | |
408 */ | 407 */ |
409 bool SK_WARN_UNUSED_RESULT rewindIfNeeded(); | 408 bool SK_WARN_UNUSED_RESULT rewindIfNeeded(); |
410 | 409 |
411 /** | 410 /** |
412 * Called by rewindIfNeeded, if the stream needed to be rewound. | 411 * Called by rewindIfNeeded, if the stream needed to be rewound. |
413 * | 412 * |
414 * Subclasses should do any set up needed after a rewind. | 413 * Subclasses should do any set up needed after a rewind. |
415 */ | 414 */ |
416 virtual bool onRewind() { | 415 virtual bool onRewind() { |
417 return true; | 416 return true; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 return this->onGetScanlines(storage.get(), countLines, 0); | 472 return this->onGetScanlines(storage.get(), countLines, 0); |
474 } | 473 } |
475 | 474 |
476 virtual SkCodec::Result onGetScanlines(void* dst, int countLines, | 475 virtual SkCodec::Result onGetScanlines(void* dst, int countLines, |
477 size_t rowBytes) { | 476 size_t rowBytes) { |
478 return kUnimplemented; | 477 return kUnimplemented; |
479 } | 478 } |
480 | 479 |
481 }; | 480 }; |
482 #endif // SkCodec_DEFINED | 481 #endif // SkCodec_DEFINED |
OLD | NEW |