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

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

Issue 2462803002: Plumb color space to DecodingImageGenerator and ImageFrameGenerator (Closed)
Patch Set: Incorporate review feedback Created 4 years, 1 month 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 jpeg_calc_output_dimensions(&m_info); 441 jpeg_calc_output_dimensions(&m_info);
442 m_decoder->setDecodedSize(m_info.output_width, m_info.output_height); 442 m_decoder->setDecodedSize(m_info.output_width, m_info.output_height);
443 443
444 m_decoder->setOrientation(readImageOrientation(info())); 444 m_decoder->setOrientation(readImageOrientation(info()));
445 445
446 // Allow color management of the decoded RGBA pixels if possible. 446 // Allow color management of the decoded RGBA pixels if possible.
447 if (!m_decoder->ignoresColorSpace()) { 447 if (!m_decoder->ignoresColorSpace()) {
448 JOCTET* profile = nullptr; 448 JOCTET* profile = nullptr;
449 unsigned profileLength = 0; 449 unsigned profileLength = 0;
450 if (read_icc_profile(info(), &profile, &profileLength)) { 450 if (read_icc_profile(info(), &profile, &profileLength)) {
451 decoder()->setColorSpaceAndComputeTransform( 451 decoder()->setColorProfileAndComputeTransform(
452 reinterpret_cast<char*>(profile), profileLength); 452 reinterpret_cast<char*>(profile), profileLength);
453 free(profile); 453 free(profile);
454 } 454 }
455 if (decoder()->colorTransform()) { 455 if (decoder()->colorTransform()) {
456 overrideColorSpace = JCS_UNKNOWN; 456 overrideColorSpace = JCS_UNKNOWN;
457 } 457 }
458 } 458 }
459 if (overrideColorSpace == JCS_YCbCr) { 459 if (overrideColorSpace == JCS_YCbCr) {
460 m_info.out_color_space = JCS_YCbCr; 460 m_info.out_color_space = JCS_YCbCr;
461 m_info.raw_data_out = TRUE; 461 m_info.raw_data_out = TRUE;
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 // has failed. 1000 // has failed.
1001 if (!m_reader->decode(onlySize) && isAllDataReceived()) 1001 if (!m_reader->decode(onlySize) && isAllDataReceived())
1002 setFailed(); 1002 setFailed();
1003 1003
1004 // If decoding is done or failed, we don't need the JPEGImageReader anymore. 1004 // If decoding is done or failed, we don't need the JPEGImageReader anymore.
1005 if (isComplete(this, onlySize) || failed()) 1005 if (isComplete(this, onlySize) || failed())
1006 m_reader.reset(); 1006 m_reader.reset();
1007 } 1007 }
1008 1008
1009 } // namespace blink 1009 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698