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

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

Issue 2523943002: Explicitly specify target color space to ImageDecoder at creation (Closed)
Patch Set: Rebase 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 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 66305823705374d2f65c7f70714b1807b514d9dd..24ddb61f5534a2525488cdb9bb07b12b29ee40a5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -722,8 +722,12 @@ void term_source(j_decompress_ptr jd) {
JPEGImageDecoder::JPEGImageDecoder(AlphaOption alphaOption,
ColorSpaceOption colorOptions,
+ sk_sp<SkColorSpace> targetColorSpace,
size_t maxDecodedBytes)
- : ImageDecoder(alphaOption, colorOptions, maxDecodedBytes) {}
+ : ImageDecoder(alphaOption,
+ colorOptions,
+ std::move(targetColorSpace),
+ maxDecodedBytes) {}
JPEGImageDecoder::~JPEGImageDecoder() {}
@@ -945,7 +949,7 @@ bool JPEGImageDecoder::outputScanlines() {
static_cast<JDIMENSION>(m_decodedSize.height()));
if (!buffer.setSizeAndColorSpace(info->output_width, info->output_height,
- colorSpace()))
+ colorSpaceForSkImages()))
return setFailed();
// The buffer is transparent outside the decoded area while the image is

Powered by Google App Engine
This is Rietveld 408576698