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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.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/ico/ICOImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
index 10ccb5d41d21128766e0e79a222a79d358d1ad17..af9c8bf7688e7cd492014875d6cf5d4017763939 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -46,8 +46,12 @@ static const size_t sizeOfDirEntry = 16;
ICOImageDecoder::ICOImageDecoder(AlphaOption alphaOption,
ColorSpaceOption colorOptions,
+ sk_sp<SkColorSpace> targetColorSpace,
size_t maxDecodedBytes)
- : ImageDecoder(alphaOption, colorOptions, maxDecodedBytes),
+ : ImageDecoder(alphaOption,
+ colorOptions,
+ std::move(targetColorSpace),
+ maxDecodedBytes),
m_fastReader(nullptr),
m_decodedOffset(0),
m_dirEntriesCount(0),
@@ -214,8 +218,8 @@ bool ICOImageDecoder::decodeAtIndex(size_t index) {
AlphaOption alphaOption =
m_premultiplyAlpha ? AlphaPremultiplied : AlphaNotPremultiplied;
m_pngDecoders[index] = wrapUnique(
- new PNGImageDecoder(alphaOption, m_colorSpaceOption, m_maxDecodedBytes,
- dirEntry.m_imageOffset));
+ new PNGImageDecoder(alphaOption, m_colorSpaceOption, m_targetColorSpace,
+ m_maxDecodedBytes, dirEntry.m_imageOffset));
setDataForPNGDecoderAtIndex(index);
}
// Fail if the size the PNGImageDecoder calculated does not match the size

Powered by Google App Engine
This is Rietveld 408576698