OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Returns true if |a| is a preferable icon entry to |b|. | 86 // Returns true if |a| is a preferable icon entry to |b|. |
87 // Larger sizes, or greater bitdepths at the same size, are preferable. | 87 // Larger sizes, or greater bitdepths at the same size, are preferable. |
88 static bool compareEntries(const IconDirectoryEntry& a, | 88 static bool compareEntries(const IconDirectoryEntry& a, |
89 const IconDirectoryEntry& b); | 89 const IconDirectoryEntry& b); |
90 | 90 |
91 // ImageDecoder: | 91 // ImageDecoder: |
92 void decodeSize() override { decode(0, true); } | 92 void decodeSize() override { decode(0, true); } |
93 size_t decodeFrameCount() override; | 93 size_t decodeFrameCount() override; |
94 void decode(size_t index) override { decode(index, false); } | 94 void decode(size_t index) override { decode(index, false); } |
95 | 95 |
96 // TODO (scroggo): These functions are identical to functions in BMPImageReade
r. Share code? | 96 // TODO (scroggo): These functions are identical to functions in |
| 97 // BMPImageReader. Share code? |
97 inline uint8_t readUint8(size_t offset) const { | 98 inline uint8_t readUint8(size_t offset) const { |
98 return m_fastReader.getOneByte(m_decodedOffset + offset); | 99 return m_fastReader.getOneByte(m_decodedOffset + offset); |
99 } | 100 } |
100 | 101 |
101 inline uint16_t readUint16(int offset) const { | 102 inline uint16_t readUint16(int offset) const { |
102 char buffer[2]; | 103 char buffer[2]; |
103 const char* data = | 104 const char* data = |
104 m_fastReader.getConsecutiveData(m_decodedOffset + offset, 2, buffer); | 105 m_fastReader.getConsecutiveData(m_decodedOffset + offset, 2, buffer); |
105 return BMPImageReader::readUint16(data); | 106 return BMPImageReader::readUint16(data); |
106 } | 107 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // for the particular entry being decoded. | 179 // for the particular entry being decoded. |
179 IntSize m_frameSize; | 180 IntSize m_frameSize; |
180 | 181 |
181 // Used to pass on to an internally created PNG decoder. | 182 // Used to pass on to an internally created PNG decoder. |
182 const GammaAndColorProfileOption m_gammaAndColorProfileOption; | 183 const GammaAndColorProfileOption m_gammaAndColorProfileOption; |
183 }; | 184 }; |
184 | 185 |
185 } // namespace blink | 186 } // namespace blink |
186 | 187 |
187 #endif | 188 #endif |
OLD | NEW |