OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 public: | 43 public: |
44 GIFImageDecoder(AlphaOption, const ColorBehavior&, size_t max_decoded_bytes); | 44 GIFImageDecoder(AlphaOption, const ColorBehavior&, size_t max_decoded_bytes); |
45 ~GIFImageDecoder() override; | 45 ~GIFImageDecoder() override; |
46 | 46 |
47 enum GIFParseQuery { kGIFSizeQuery, kGIFFrameCountQuery }; | 47 enum GIFParseQuery { kGIFSizeQuery, kGIFFrameCountQuery }; |
48 | 48 |
49 // ImageDecoder: | 49 // ImageDecoder: |
50 String FilenameExtension() const override { return "gif"; } | 50 String FilenameExtension() const override { return "gif"; } |
51 void OnSetData(SegmentReader* data) override; | 51 void OnSetData(SegmentReader* data) override; |
52 int RepetitionCount() const override; | 52 int RepetitionCount() const override; |
53 bool FrameIsCompleteAtIndex(size_t) const override; | 53 bool FrameIsReceivedAtIndex(size_t) const override; |
54 float FrameDurationAtIndex(size_t) const override; | 54 float FrameDurationAtIndex(size_t) const override; |
55 // CAUTION: SetFailed() deletes |reader_|. Be careful to avoid | 55 // CAUTION: SetFailed() deletes |reader_|. Be careful to avoid |
56 // accessing deleted memory, especially when calling this from inside | 56 // accessing deleted memory, especially when calling this from inside |
57 // GIFImageReader! | 57 // GIFImageReader! |
58 bool SetFailed() override; | 58 bool SetFailed() override; |
59 | 59 |
60 // Callbacks from the GIF reader. | 60 // Callbacks from the GIF reader. |
61 bool HaveDecodedRow(size_t frame_index, | 61 bool HaveDecodedRow(size_t frame_index, |
62 GIFRow::const_iterator row_begin, | 62 GIFRow::const_iterator row_begin, |
63 size_t width, | 63 size_t width, |
(...skipping 28 matching lines...) Expand all Loading... |
92 bool CanReusePreviousFrameBuffer(size_t) const override; | 92 bool CanReusePreviousFrameBuffer(size_t) const override; |
93 | 93 |
94 bool current_buffer_saw_alpha_; | 94 bool current_buffer_saw_alpha_; |
95 mutable int repetition_count_; | 95 mutable int repetition_count_; |
96 std::unique_ptr<GIFImageReader> reader_; | 96 std::unique_ptr<GIFImageReader> reader_; |
97 }; | 97 }; |
98 | 98 |
99 } // namespace blink | 99 } // namespace blink |
100 | 100 |
101 #endif | 101 #endif |
OLD | NEW |