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

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

Issue 1523243002: [qcms] Apply qcms color matching api to Blink images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update TestExpectations: account for crbug.com/569600 Created 5 years 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
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 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 clearColorTransform(); 643 clearColorTransform();
644 644
645 if (colorProfile.isEmpty()) 645 if (colorProfile.isEmpty())
646 return; 646 return;
647 qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile(); 647 qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
648 if (!deviceProfile) 648 if (!deviceProfile)
649 return; 649 return;
650 qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data( ), colorProfile.size()); 650 qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data( ), colorProfile.size());
651 if (!inputProfile) 651 if (!inputProfile)
652 return; 652 return;
653
653 // We currently only support color profiles for RGB profiled images. 654 // We currently only support color profiles for RGB profiled images.
654 ASSERT(rgbData == qcms_profile_get_color_space(inputProfile)); 655 ASSERT(rgbData == qcms_profile_get_color_space(inputProfile));
656
657 if (qcms_profile_match(inputProfile, deviceProfile)) {
658 qcms_profile_release(inputProfile);
659 return;
660 }
661
662 // FIXME: Don't force perceptual intent if the image profile contains an intent.
655 qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_ 8; 663 qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_ 8;
656 // FIXME: Don't force perceptual intent if the image profile contains an intent.
657 m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProf ile, dataFormat, QCMS_INTENT_PERCEPTUAL); 664 m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProf ile, dataFormat, QCMS_INTENT_PERCEPTUAL);
665
658 qcms_profile_release(inputProfile); 666 qcms_profile_release(inputProfile);
659 } 667 }
660 #endif 668 #endif
661 669
662 private: 670 private:
663 JSAMPARRAY allocateSampleArray() 671 JSAMPARRAY allocateSampleArray()
664 { 672 {
665 // Some output color spaces don't need the sample array: don't allocate in that case. 673 // Some output color spaces don't need the sample array: don't allocate in that case.
666 #if defined(TURBO_JPEG_RGB_SWIZZLE) 674 #if defined(TURBO_JPEG_RGB_SWIZZLE)
667 if (turboSwizzled(m_info.out_color_space)) 675 if (turboSwizzled(m_info.out_color_space))
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 // has failed. 1071 // has failed.
1064 if (!m_reader->decode(onlySize) && isAllDataReceived()) 1072 if (!m_reader->decode(onlySize) && isAllDataReceived())
1065 setFailed(); 1073 setFailed();
1066 1074
1067 // If decoding is done or failed, we don't need the JPEGImageReader anymore. 1075 // If decoding is done or failed, we don't need the JPEGImageReader anymore.
1068 if (isComplete(this, onlySize) || failed()) 1076 if (isComplete(this, onlySize) || failed())
1069 m_reader.clear(); 1077 m_reader.clear();
1070 } 1078 }
1071 1079
1072 } 1080 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698