| 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 "SkImageInfo.h" | 9 #include "SkImageInfo.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * Assumes IsGif was called and returned true | 27 * Assumes IsGif was called and returned true |
| 28 * Creates a gif decoder | 28 * Creates a gif decoder |
| 29 * Reads enough of the stream to determine the image format | 29 * Reads enough of the stream to determine the image format |
| 30 */ | 30 */ |
| 31 static SkCodec* NewFromStream(SkStream*); | 31 static SkCodec* NewFromStream(SkStream*); |
| 32 | 32 |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 | 35 |
| 36 /* | 36 /* |
| 37 * Read enough of the stream to initialize the SkGifCodec. |
| 38 * Returns a bool representing success or failure. |
| 39 * If it returned true, and codecOut was not NULL, |
| 40 * it will be set to a new SkGifCodec. |
| 41 */ |
| 42 static bool ReadHeader(SkStream*, SkCodec** codecOut); |
| 43 |
| 44 /* |
| 37 * Initiates the gif decode | 45 * Initiates the gif decode |
| 38 */ | 46 */ |
| 39 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, | 47 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, |
| 40 SkPMColor*, int32_t*) override; | 48 SkPMColor*, int32_t*) override; |
| 41 | 49 |
| 42 SkEncodedFormat onGetEncodedFormat() const override { | 50 SkEncodedFormat onGetEncodedFormat() const override { |
| 43 return kGIF_SkEncodedFormat; | 51 return kGIF_SkEncodedFormat; |
| 44 } | 52 } |
| 45 | 53 |
| 46 private: | 54 private: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 65 * @param stream the stream of image data | 73 * @param stream the stream of image data |
| 66 * @param gif pointer to library type that manages gif decode | 74 * @param gif pointer to library type that manages gif decode |
| 67 * takes ownership | 75 * takes ownership |
| 68 */ | 76 */ |
| 69 SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream, GifFileType* gif); | 77 SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream, GifFileType* gif); |
| 70 | 78 |
| 71 SkAutoTCallIProc<GifFileType, CloseGif> fGif; // owned | 79 SkAutoTCallIProc<GifFileType, CloseGif> fGif; // owned |
| 72 | 80 |
| 73 typedef SkCodec INHERITED; | 81 typedef SkCodec INHERITED; |
| 74 }; | 82 }; |
| OLD | NEW |