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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ImageFrame::FrameComplete)) | 71 ImageFrame::FrameComplete)) |
72 m_reader.reset(); | 72 m_reader.reset(); |
73 } | 73 } |
74 | 74 |
75 bool BMPImageDecoder::decodeHelper(bool onlySize) { | 75 bool BMPImageDecoder::decodeHelper(bool onlySize) { |
76 size_t imgDataOffset = 0; | 76 size_t imgDataOffset = 0; |
77 if ((m_decodedOffset < sizeOfFileHeader) && !processFileHeader(imgDataOffset)) | 77 if ((m_decodedOffset < sizeOfFileHeader) && !processFileHeader(imgDataOffset)) |
78 return false; | 78 return false; |
79 | 79 |
80 if (!m_reader) { | 80 if (!m_reader) { |
81 m_reader = wrapUnique( | 81 m_reader = WTF::wrapUnique( |
82 new BMPImageReader(this, m_decodedOffset, imgDataOffset, false)); | 82 new BMPImageReader(this, m_decodedOffset, imgDataOffset, false)); |
83 m_reader->setData(m_data.get()); | 83 m_reader->setData(m_data.get()); |
84 } | 84 } |
85 | 85 |
86 if (!m_frameBufferCache.isEmpty()) | 86 if (!m_frameBufferCache.isEmpty()) |
87 m_reader->setBuffer(&m_frameBufferCache.front()); | 87 m_reader->setBuffer(&m_frameBufferCache.front()); |
88 | 88 |
89 return m_reader->decodeBMP(onlySize); | 89 return m_reader->decodeBMP(onlySize); |
90 } | 90 } |
91 | 91 |
(...skipping 23 matching lines...) Expand all Loading... |
115 POINTER = 0x5054, // "PT" | 115 POINTER = 0x5054, // "PT" |
116 COLORICON = 0x4349, // "CI" | 116 COLORICON = 0x4349, // "CI" |
117 COLORPOINTER = 0x4350, // "CP" | 117 COLORPOINTER = 0x4350, // "CP" |
118 BITMAPARRAY = 0x4241, // "BA" | 118 BITMAPARRAY = 0x4241, // "BA" |
119 */ | 119 */ |
120 }; | 120 }; |
121 return (fileType == BMAP) || setFailed(); | 121 return (fileType == BMAP) || setFailed(); |
122 } | 122 } |
123 | 123 |
124 } // namespace blink | 124 } // namespace blink |
OLD | NEW |