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