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

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

Issue 2454123002: Refactor image decoders to use 'colorSpace' instead of 'colorProfile' (Closed)
Patch Set: Fix legacy ImageFrame Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 43f5ee9ad41e0ebb832c54f6b6868043fbebb526..153220d945b08a4b28b35854629a5230ef3ee84c 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -444,13 +444,12 @@ class JPEGImageReader final {
m_decoder->setOrientation(readImageOrientation(info()));
// Allow color management of the decoded RGBA pixels if possible.
- if (!m_decoder->ignoresGammaAndColorProfile()) {
+ if (!m_decoder->ignoresColorSpace()) {
JOCTET* profile = nullptr;
unsigned profileLength = 0;
if (read_icc_profile(info(), &profile, &profileLength)) {
decoder()->setColorSpaceAndComputeTransform(
- reinterpret_cast<char*>(profile), profileLength,
- false /* useSRGB */);
+ reinterpret_cast<char*>(profile), profileLength);
free(profile);
}
if (decoder()->colorTransform()) {
@@ -706,7 +705,7 @@ void term_source(j_decompress_ptr jd) {
}
JPEGImageDecoder::JPEGImageDecoder(AlphaOption alphaOption,
- GammaAndColorProfileOption colorOptions,
+ ColorSpaceOption colorOptions,
size_t maxDecodedBytes)
: ImageDecoder(alphaOption, colorOptions, maxDecodedBytes) {}
@@ -929,8 +928,8 @@ bool JPEGImageDecoder::outputScanlines() {
ASSERT(info->output_height ==
static_cast<JDIMENSION>(m_decodedSize.height()));
- if (!buffer.setSizeAndColorProfile(info->output_width, info->output_height,
- colorProfile()))
+ if (!buffer.setSizeAndColorSpace(info->output_width, info->output_height,
+ colorSpace()))
return setFailed();
// The buffer is transparent outside the decoded area while the image is

Powered by Google App Engine
This is Rietveld 408576698