Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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) | 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; } | 78 inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; } |
| 80 #else | 79 #else |
| 80 inline J_DITHER_MODE ditherMode() { return JDITHER_FS; } | |
| 81 #endif | |
| 82 | |
| 83 #if USE(LOW_QUALITY_IMAGE_FAST_JPEG_DCT) | |
|
Peter Kasting
2014/06/17 17:49:04
If nobody uses this, I'd scrap it and add a commen
Ken Russell (switch to Gerrit)
2014/06/17 21:28:35
Agree with this comment.
| |
| 84 inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; } | |
| 85 #else | |
| 81 inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; } | 86 inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; } |
| 82 inline J_DITHER_MODE ditherMode() { return JDITHER_FS; } | |
| 83 #endif | 87 #endif |
| 84 | 88 |
| 85 #if USE(LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING) | 89 #if USE(LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING) |
| 86 inline bool doFancyUpsampling() { return false; } | 90 inline bool doFancyUpsampling() { return false; } |
| 87 #else | 91 #else |
| 88 inline bool doFancyUpsampling() { return true; } | 92 inline bool doFancyUpsampling() { return true; } |
| 89 #endif | 93 #endif |
| 90 | 94 |
| 91 namespace { | 95 namespace { |
| 92 | 96 |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 // has failed. | 802 // has failed. |
| 799 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 803 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
| 800 setFailed(); | 804 setFailed(); |
| 801 // If we're done decoding the image, we don't need the JPEGImageReader | 805 // If we're done decoding the image, we don't need the JPEGImageReader |
| 802 // anymore. (If we failed, |m_reader| has already been cleared.) | 806 // anymore. (If we failed, |m_reader| has already been cleared.) |
| 803 else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete)) | 807 else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete)) |
| 804 m_reader.clear(); | 808 m_reader.clear(); |
| 805 } | 809 } |
| 806 | 810 |
| 807 } | 811 } |
| OLD | NEW |