| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if (m_needToProcessBitmasks && !processBitmasks()) | 112 if (m_needToProcessBitmasks && !processBitmasks()) |
| 113 return false; | 113 return false; |
| 114 | 114 |
| 115 // Read and process the color table, if needed. | 115 // Read and process the color table, if needed. |
| 116 if (m_needToProcessColorTable && !processColorTable()) | 116 if (m_needToProcessColorTable && !processColorTable()) |
| 117 return false; | 117 return false; |
| 118 | 118 |
| 119 // Initialize the framebuffer if needed. | 119 // Initialize the framebuffer if needed. |
| 120 ASSERT(m_buffer); // Parent should set this before asking us to decode! | 120 ASSERT(m_buffer); // Parent should set this before asking us to decode! |
| 121 if (m_buffer->getStatus() == ImageFrame::FrameEmpty) { | 121 if (m_buffer->getStatus() == ImageFrame::FrameEmpty) { |
| 122 if (!m_buffer->setSize(m_parent->size().width(), m_parent->size().height
())) | 122 if (!m_buffer->setSizeAndColorProfile(m_parent->size().width(), m_parent
->size().height(), ImageFrame::ICCProfile())) |
| 123 return m_parent->setFailed(); // Unable to allocate. | 123 return m_parent->setFailed(); // Unable to allocate. |
| 124 m_buffer->setStatus(ImageFrame::FramePartial); | 124 m_buffer->setStatus(ImageFrame::FramePartial); |
| 125 // setSize() calls eraseARGB(), which resets the alpha flag, so we force | 125 // setSize() calls eraseARGB(), which resets the alpha flag, so we force |
| 126 // it back to false here. We'll set it true below in all cases where | 126 // it back to false here. We'll set it true below in all cases where |
| 127 // these 0s could actually show through. | 127 // these 0s could actually show through. |
| 128 m_buffer->setHasAlpha(false); | 128 m_buffer->setHasAlpha(false); |
| 129 | 129 |
| 130 // For BMPs, the frame always fills the entire image. | 130 // For BMPs, the frame always fills the entire image. |
| 131 m_buffer->setOriginalFrameRect(IntRect(IntPoint(), m_parent->size())); | 131 m_buffer->setOriginalFrameRect(IntRect(IntPoint(), m_parent->size())); |
| 132 | 132 |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 // Finished decoding whole image. | 812 // Finished decoding whole image. |
| 813 return Success; | 813 return Success; |
| 814 } | 814 } |
| 815 | 815 |
| 816 void BMPImageReader::moveBufferToNextRow() | 816 void BMPImageReader::moveBufferToNextRow() |
| 817 { | 817 { |
| 818 m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1); | 818 m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1); |
| 819 } | 819 } |
| 820 | 820 |
| 821 } // namespace blink | 821 } // namespace blink |
| OLD | NEW |