| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #else // Output little-endian BGRA pixels. | 67 #else // Output little-endian BGRA pixels. |
| 68 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; } | 68 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; } |
| 69 #endif | 69 #endif |
| 70 inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == JCS_E
XT_RGBA || colorSpace == JCS_EXT_BGRA; } | 70 inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == JCS_E
XT_RGBA || colorSpace == JCS_EXT_BGRA; } |
| 71 inline bool colorSpaceHasAlpha(J_COLOR_SPACE colorSpace) { return turboSwizzled(
colorSpace); } | 71 inline bool colorSpaceHasAlpha(J_COLOR_SPACE colorSpace) { return turboSwizzled(
colorSpace); } |
| 72 #else | 72 #else |
| 73 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; } | 73 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; } |
| 74 inline bool colorSpaceHasAlpha(J_COLOR_SPACE) { return false; } | 74 inline bool colorSpaceHasAlpha(J_COLOR_SPACE) { return false; } |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 #if USE(LOW_QUALITY_IMAGE_NO_JPEG_DITHERING) | |
| 78 inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; } | |
| 79 inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; } | |
| 80 #else | |
| 81 inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; } | 77 inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; } |
| 82 inline J_DITHER_MODE ditherMode() { return JDITHER_FS; } | 78 inline J_DITHER_MODE ditherMode() { return JDITHER_FS; } |
| 83 #endif | |
| 84 | |
| 85 #if USE(LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING) | |
| 86 inline bool doFancyUpsampling() { return false; } | |
| 87 #else | |
| 88 inline bool doFancyUpsampling() { return true; } | 79 inline bool doFancyUpsampling() { return true; } |
| 89 #endif | |
| 90 | 80 |
| 91 namespace { | 81 namespace { |
| 92 | 82 |
| 93 const int exifMarker = JPEG_APP0 + 1; | 83 const int exifMarker = JPEG_APP0 + 1; |
| 94 | 84 |
| 95 // JPEG only supports a denominator of 8. | 85 // JPEG only supports a denominator of 8. |
| 96 const unsigned scaleDenominator = 8; | 86 const unsigned scaleDenominator = 8; |
| 97 | 87 |
| 98 } // namespace | 88 } // namespace |
| 99 | 89 |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 // has failed. | 1002 // has failed. |
| 1013 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 1003 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
| 1014 setFailed(); | 1004 setFailed(); |
| 1015 // If we're done decoding the image, we don't need the JPEGImageReader | 1005 // If we're done decoding the image, we don't need the JPEGImageReader |
| 1016 // anymore. (If we failed, |m_reader| has already been cleared.) | 1006 // anymore. (If we failed, |m_reader| has already been cleared.) |
| 1017 else if ((!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() =
= ImageFrame::FrameComplete)) || (hasImagePlanes() && !onlySize)) | 1007 else if ((!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() =
= ImageFrame::FrameComplete)) || (hasImagePlanes() && !onlySize)) |
| 1018 m_reader.clear(); | 1008 m_reader.clear(); |
| 1019 } | 1009 } |
| 1020 | 1010 |
| 1021 } | 1011 } |
| OLD | NEW |