OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 String filenameExtension() const override { return "webp"; } | 46 String filenameExtension() const override { return "webp"; } |
47 bool hasColorProfile() const override { return m_hasColorProfile; } | 47 bool hasColorProfile() const override { return m_hasColorProfile; } |
48 void setData(SharedBuffer* data, bool allDataReceived) override; | 48 void setData(SharedBuffer* data, bool allDataReceived) override; |
49 int repetitionCount() const override; | 49 int repetitionCount() const override; |
50 bool frameIsCompleteAtIndex(size_t) const override; | 50 bool frameIsCompleteAtIndex(size_t) const override; |
51 float frameDurationAtIndex(size_t) const override; | 51 float frameDurationAtIndex(size_t) const override; |
52 size_t clearCacheExceptFrame(size_t) override; | 52 size_t clearCacheExceptFrame(size_t) override; |
53 | 53 |
54 private: | 54 private: |
55 // ImageDecoder: | 55 // ImageDecoder: |
56 virtual void decodeSize() { updateDemuxer(); } | 56 void decodeSize() override |
| 57 { |
| 58 updateDemuxer(); |
| 59 reportStats(ImageWebP); |
| 60 } |
57 size_t decodeFrameCount() override; | 61 size_t decodeFrameCount() override; |
58 void initializeNewFrame(size_t) override; | 62 void initializeNewFrame(size_t) override; |
59 void decode(size_t) override; | 63 void decode(size_t) override; |
60 | 64 |
61 bool decodeSingleFrame(const uint8_t* dataBytes, size_t dataSize, size_t fra
meIndex); | 65 bool decodeSingleFrame(const uint8_t* dataBytes, size_t dataSize, size_t fra
meIndex); |
62 | 66 |
63 WebPIDecoder* m_decoder; | 67 WebPIDecoder* m_decoder; |
64 WebPDecBuffer m_decoderBuffer; | 68 WebPDecBuffer m_decoderBuffer; |
65 int m_formatFlags; | 69 int m_formatFlags; |
66 bool m_frameBackgroundHasAlpha; | 70 bool m_frameBackgroundHasAlpha; |
(...skipping 22 matching lines...) Expand all Loading... |
89 typedef void (*AlphaBlendFunction)(ImageFrame&, ImageFrame&, int, int, int); | 93 typedef void (*AlphaBlendFunction)(ImageFrame&, ImageFrame&, int, int, int); |
90 AlphaBlendFunction m_blendFunction; | 94 AlphaBlendFunction m_blendFunction; |
91 | 95 |
92 void clear(); | 96 void clear(); |
93 void clearDecoder(); | 97 void clearDecoder(); |
94 }; | 98 }; |
95 | 99 |
96 } // namespace blink | 100 } // namespace blink |
97 | 101 |
98 #endif | 102 #endif |
OLD | NEW |