1 This reverts http://trac.webkit.org/changeset/101286
2 to fix Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=393471
4 Index: third_party/WebKit/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
5 ===================================================================
6 --- third_party/WebKit/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (revision 96970)
7 +++ third_party/WebKit/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (revision 101286)
12 -#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
13 -#define ASSUME_LITTLE_ENDIAN 0
15 -#define ASSUME_LITTLE_ENDIAN 1
18 -#if defined(JCS_EXTENSIONS) && ASSUME_LITTLE_ENDIAN
19 -#define TURBO_JPEG_RGB_SWIZZLE
20 -#if USE(SKIA) && (!SK_R32_SHIFT && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16)
21 -inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBX; }
23 -inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRX; }
25 -inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == rgbOutputColorSpace(); }
27 -inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; }
32 struct decoder_error_mgr {
36 // libjpeg can convert GRAYSCALE and YCbCr image pixels to RGB.
37 - m_info.out_color_space = rgbOutputColorSpace();
38 + m_info.out_color_space = JCS_RGB;
45 jpeg_decompress_struct* info = m_reader->info();
47 -#if !ENABLE(IMAGE_DECODER_DOWN_SAMPLING) && defined(TURBO_JPEG_RGB_SWIZZLE)
48 - if (turboSwizzled(info->out_color_space)) {
50 - while (info->output_scanline < info->output_height) {
51 - unsigned char* row = reinterpret_cast<unsigned char*>(buffer.getAddr(0, info->output_scanline));
52 - if (jpeg_read_scanlines(info, &row, 1) != 1)
59 JSAMPARRAY samples = m_reader->samples();
61 while (info->output_scanline < info->output_height) {