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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.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/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 504b59a0a192b5f6cf363f98c3bd8e0f598362ee..a3fa61c984004e921f2f1bf0fc5ffd19e99c87b5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -118,8 +118,12 @@ namespace blink {
WEBPImageDecoder::WEBPImageDecoder(AlphaOption alphaOption,
ColorSpaceOption colorOptions,
+ sk_sp<SkColorSpace> targetColorSpace,
size_t maxDecodedBytes)
- : ImageDecoder(alphaOption, colorOptions, maxDecodedBytes),
+ : ImageDecoder(alphaOption,
+ colorOptions,
+ std::move(targetColorSpace),
+ maxDecodedBytes),
m_decoder(0),
m_formatFlags(0),
m_frameBackgroundHasAlpha(false),
@@ -484,7 +488,7 @@ bool WEBPImageDecoder::decodeSingleFrame(const uint8_t* dataBytes,
if (buffer.getStatus() == ImageFrame::FrameEmpty) {
if (!buffer.setSizeAndColorSpace(size().width(), size().height(),
- colorSpace()))
+ colorSpaceForSkImages()))
return setFailed();
buffer.setStatus(ImageFrame::FramePartial);
// The buffer is transparent outside the decoded area while the image is

Powered by Google App Engine
This is Rietveld 408576698