| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 /* | 57 /* |
| 58 * Initiates the gif decode | 58 * Initiates the gif decode |
| 59 */ | 59 */ |
| 60 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, | 60 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, |
| 61 SkPMColor*, int32_t*) override; | 61 SkPMColor*, int32_t*) override; |
| 62 | 62 |
| 63 SkEncodedFormat onGetEncodedFormat() const override { | 63 SkEncodedFormat onGetEncodedFormat() const override { |
| 64 return kGIF_SkEncodedFormat; | 64 return kGIF_SkEncodedFormat; |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool onRewind() override; |
| 68 |
| 67 private: | 69 private: |
| 68 | 70 |
| 69 /* | 71 /* |
| 70 * This function cleans up the gif object after the decode completes | 72 * This function cleans up the gif object after the decode completes |
| 71 * It is used in a SkAutoTCallIProc template | 73 * It is used in a SkAutoTCallIProc template |
| 72 */ | 74 */ |
| 73 static void CloseGif(GifFileType* gif); | 75 static void CloseGif(GifFileType* gif); |
| 74 | 76 |
| 75 /* | 77 /* |
| 76 * Frees any extension data used in the decode | 78 * Frees any extension data used in the decode |
| 77 * Used in a SkAutoTCallVProc | 79 * Used in a SkAutoTCallVProc |
| 78 */ | 80 */ |
| 79 static void FreeExtension(SavedImage* image); | 81 static void FreeExtension(SavedImage* image); |
| 80 | 82 |
| 81 /* | 83 /* |
| 82 * Creates an instance of the decoder | 84 * Creates an instance of the decoder |
| 83 * Called only by NewFromStream | 85 * Called only by NewFromStream |
| 84 * | 86 * |
| 85 * @param srcInfo contains the source width and height | 87 * @param srcInfo contains the source width and height |
| 86 * @param stream the stream of image data | 88 * @param stream the stream of image data |
| 87 * @param gif pointer to library type that manages gif decode | 89 * @param gif pointer to library type that manages gif decode |
| 88 * takes ownership | 90 * takes ownership |
| 89 */ | 91 */ |
| 90 SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream, GifFileType* gif); | 92 SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream, GifFileType* gif); |
| 91 | 93 |
| 92 SkAutoTCallVProc<GifFileType, CloseGif> fGif; // owned | 94 SkAutoTCallVProc<GifFileType, CloseGif> fGif; // owned |
| 93 | 95 |
| 94 typedef SkCodec INHERITED; | 96 typedef SkCodec INHERITED; |
| 95 }; | 97 }; |
| OLD | NEW |