| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 2001-6 mozilla.org | 4 * Portions are Copyright (C) 2001-6 mozilla.org |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Stuart Parmenter <stuart@mozilla.com> | 7 * Stuart Parmenter <stuart@mozilla.com> |
| 8 * | 8 * |
| 9 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 9 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
| 10 * | 10 * |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 JPEG_DECOMPRESS_PROGRESSIVE, // Output progressive pixels | 101 JPEG_DECOMPRESS_PROGRESSIVE, // Output progressive pixels |
| 102 JPEG_DECOMPRESS_SEQUENTIAL, // Output sequential pixels | 102 JPEG_DECOMPRESS_SEQUENTIAL, // Output sequential pixels |
| 103 JPEG_DONE, | 103 JPEG_DONE, |
| 104 JPEG_ERROR | 104 JPEG_ERROR |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 void init_source(j_decompress_ptr jd); | 107 void init_source(j_decompress_ptr jd); |
| 108 boolean fill_input_buffer(j_decompress_ptr jd); | 108 boolean fill_input_buffer(j_decompress_ptr jd); |
| 109 void skip_input_data(j_decompress_ptr jd, long num_bytes); | 109 void skip_input_data(j_decompress_ptr jd, long num_bytes); |
| 110 void term_source(j_decompress_ptr jd); | 110 void term_source(j_decompress_ptr jd); |
| 111 #if PLATFORM(QT) | |
| 112 void error_exit(j_common_ptr) NO_RETURN; | |
| 113 #else | |
| 114 void error_exit(j_common_ptr cinfo); | 111 void error_exit(j_common_ptr cinfo); |
| 115 #endif | |
| 116 | 112 |
| 117 // Implementation of a JPEG src object that understands our state machine | 113 // Implementation of a JPEG src object that understands our state machine |
| 118 struct decoder_source_mgr { | 114 struct decoder_source_mgr { |
| 119 // public fields; must be first in this struct! | 115 // public fields; must be first in this struct! |
| 120 struct jpeg_source_mgr pub; | 116 struct jpeg_source_mgr pub; |
| 121 | 117 |
| 122 JPEGImageReader* decoder; | 118 JPEGImageReader* decoder; |
| 123 }; | 119 }; |
| 124 | 120 |
| 125 static unsigned readUint16(JOCTET* data, bool isBigEndian) | 121 static unsigned readUint16(JOCTET* data, bool isBigEndian) |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 // has failed. | 779 // has failed. |
| 784 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 780 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
| 785 setFailed(); | 781 setFailed(); |
| 786 // If we're done decoding the image, we don't need the JPEGImageReader | 782 // If we're done decoding the image, we don't need the JPEGImageReader |
| 787 // anymore. (If we failed, |m_reader| has already been cleared.) | 783 // anymore. (If we failed, |m_reader| has already been cleared.) |
| 788 else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() ==
ImageFrame::FrameComplete)) | 784 else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() ==
ImageFrame::FrameComplete)) |
| 789 m_reader.clear(); | 785 m_reader.clear(); |
| 790 } | 786 } |
| 791 | 787 |
| 792 } | 788 } |
| OLD | NEW |