Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

Issue 10388157: Merge 116636 - [chromium] REGRESSION(r107389) Visible line artifacts on some JPEG images (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include <setjmp.h> 63 #include <setjmp.h>
64 } 64 }
65 65
66 #if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN) 66 #if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
67 #define ASSUME_LITTLE_ENDIAN 0 67 #define ASSUME_LITTLE_ENDIAN 0
68 #else 68 #else
69 #define ASSUME_LITTLE_ENDIAN 1 69 #define ASSUME_LITTLE_ENDIAN 1
70 #endif 70 #endif
71 71
72 #if defined(JCS_ALPHA_EXTENSIONS) && ASSUME_LITTLE_ENDIAN 72 #if defined(JCS_ALPHA_EXTENSIONS) && ASSUME_LITTLE_ENDIAN
73 inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; }
74 #define TURBO_JPEG_RGB_SWIZZLE 73 #define TURBO_JPEG_RGB_SWIZZLE
75 #if USE(SKIA) && (!SK_R32_SHIFT && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16) 74 #if USE(SKIA) && (!SK_R32_SHIFT && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16)
76 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBA; } 75 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBA; }
77 #else 76 #else
78 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; } 77 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; }
79 #endif 78 #endif
80 inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == rgbOu tputColorSpace(); } 79 inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == rgbOu tputColorSpace(); }
81 #else 80 #else
82 inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; }
83 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; } 81 inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; }
84 #endif 82 #endif
85 83
86 #if OS(ANDROID) 84 #if OS(ANDROID)
85 inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; }
87 inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; } 86 inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; }
88 inline bool doFancyUpsampling() { return false; } 87 inline bool doFancyUpsampling() { return false; }
89 #else 88 #else
89 inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; }
90 inline J_DITHER_MODE ditherMode() { return JDITHER_FS; } 90 inline J_DITHER_MODE ditherMode() { return JDITHER_FS; }
91 inline bool doFancyUpsampling() { return true; } 91 inline bool doFancyUpsampling() { return true; }
92 #endif 92 #endif
93 93
94 namespace WebCore { 94 namespace WebCore {
95 95
96 struct decoder_error_mgr { 96 struct decoder_error_mgr {
97 struct jpeg_error_mgr pub; // "public" fields for IJG library 97 struct jpeg_error_mgr pub; // "public" fields for IJG library
98 jmp_buf setjmp_buffer; // For handling catastropic errors 98 jmp_buf setjmp_buffer; // For handling catastropic errors
99 }; 99 };
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // has failed. 599 // has failed.
600 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) 600 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
601 setFailed(); 601 setFailed();
602 // If we're done decoding the image, we don't need the JPEGImageReader 602 // If we're done decoding the image, we don't need the JPEGImageReader
603 // anymore. (If we failed, |m_reader| has already been cleared.) 603 // anymore. (If we failed, |m_reader| has already been cleared.)
604 else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete)) 604 else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete))
605 m_reader.clear(); 605 m_reader.clear();
606 } 606 }
607 607
608 } 608 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698