Chromium Code Reviews| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 300 // during processBitmasks(). | 300 // during processBitmasks(). |
| 301 if (isWindowsV4Plus()) { | 301 if (isWindowsV4Plus()) { |
| 302 m_bitMasks[0] = readUint32(40); | 302 m_bitMasks[0] = readUint32(40); |
| 303 m_bitMasks[1] = readUint32(44); | 303 m_bitMasks[1] = readUint32(44); |
| 304 m_bitMasks[2] = readUint32(48); | 304 m_bitMasks[2] = readUint32(48); |
| 305 m_bitMasks[3] = readUint32(52); | 305 m_bitMasks[3] = readUint32(52); |
| 306 } | 306 } |
| 307 | 307 |
| 308 // Detect top-down BMPs. | 308 // Detect top-down BMPs. |
| 309 if (m_infoHeader.biHeight < 0) { | 309 if (m_infoHeader.biHeight < 0) { |
| 310 if (m_infoHeader.biHeight == INT32_MIN) | |
|
Peter Kasting
2016/08/17 22:21:24
Nit: I think this deserves a comment, e.g.:
We ca
aleksandar.stojiljkovic
2016/08/18 21:31:00
Done.
| |
| 311 return false; | |
|
Peter Kasting
2016/08/17 22:21:24
You need to return m_parent->setFailed() here, not
aleksandar.stojiljkovic
2016/08/18 21:31:00
Done.
Thanks. Although the returned false gets pro
| |
| 310 m_isTopDown = true; | 312 m_isTopDown = true; |
| 311 m_infoHeader.biHeight = -m_infoHeader.biHeight; | 313 m_infoHeader.biHeight = -m_infoHeader.biHeight; |
| 312 } | 314 } |
| 313 | 315 |
| 314 return true; | 316 return true; |
| 315 } | 317 } |
| 316 | 318 |
| 317 bool BMPImageReader::isInfoHeaderValid() const | 319 bool BMPImageReader::isInfoHeaderValid() const |
| 318 { | 320 { |
| 319 // Non-positive widths/heights are invalid. (We've already flipped the | 321 // Non-positive widths/heights are invalid. (We've already flipped the |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 812 // Finished decoding whole image. | 814 // Finished decoding whole image. |
| 813 return Success; | 815 return Success; |
| 814 } | 816 } |
| 815 | 817 |
| 816 void BMPImageReader::moveBufferToNextRow() | 818 void BMPImageReader::moveBufferToNextRow() |
| 817 { | 819 { |
| 818 m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1); | 820 m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1); |
| 819 } | 821 } |
| 820 | 822 |
| 821 } // namespace blink | 823 } // namespace blink |
| OLD | NEW |