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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 uint16_t m_bitCount; | 72 uint16_t m_bitCount; |
73 IntPoint m_hotSpot; | 73 IntPoint m_hotSpot; |
74 uint32_t m_imageOffset; | 74 uint32_t m_imageOffset; |
75 }; | 75 }; |
76 | 76 |
77 // Returns true if |a| is a preferable icon entry to |b|. | 77 // Returns true if |a| is a preferable icon entry to |b|. |
78 // Larger sizes, or greater bitdepths at the same size, are preferable. | 78 // Larger sizes, or greater bitdepths at the same size, are preferable. |
79 static bool compareEntries(const IconDirectoryEntry& a, const IconDirectoryE ntry& b); | 79 static bool compareEntries(const IconDirectoryEntry& a, const IconDirectoryE ntry& b); |
80 | 80 |
81 // ImageDecoder: | 81 // ImageDecoder: |
82 virtual void decodeSize() { decode(0, true); } | 82 virtual void decodeSize() |
83 { | |
84 decode(0, true); | |
85 reportStats(ImageICO); | |
Noel Gordon
2015/07/30 18:11:47
Considering that each ICO decoder has one or more
urvang
2015/07/30 18:52:36
Ah good point, thanks!
| |
86 } | |
83 size_t decodeFrameCount() override; | 87 size_t decodeFrameCount() override; |
84 void decode(size_t index) override { decode(index, false); } | 88 void decode(size_t index) override { decode(index, false); } |
85 | 89 |
86 inline uint16_t readUint16(int offset) const | 90 inline uint16_t readUint16(int offset) const |
87 { | 91 { |
88 return BMPImageReader::readUint16(m_data.get(), m_decodedOffset + offset ); | 92 return BMPImageReader::readUint16(m_data.get(), m_decodedOffset + offset ); |
89 } | 93 } |
90 | 94 |
91 inline uint32_t readUint32(int offset) const | 95 inline uint32_t readUint32(int offset) const |
92 { | 96 { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 PNGDecoders m_pngDecoders; | 153 PNGDecoders m_pngDecoders; |
150 | 154 |
151 // Valid only while a BMPImageReader is decoding, this holds the size | 155 // Valid only while a BMPImageReader is decoding, this holds the size |
152 // for the particular entry being decoded. | 156 // for the particular entry being decoded. |
153 IntSize m_frameSize; | 157 IntSize m_frameSize; |
154 }; | 158 }; |
155 | 159 |
156 } // namespace blink | 160 } // namespace blink |
157 | 161 |
158 #endif | 162 #endif |
OLD | NEW |