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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp

Issue 2787053004: Respect colorSpace in DecodingImageGenerator::onGetPixels() (Closed)
Patch Set: Response to comments Created 3 years, 8 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/graphics/ImageFrameGenerator.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
index caff5e4cca0f89744ffc0e7a61b000555e3b248f..2fa4597ec567fb37836b1ad97553bd318a1e706f 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -111,7 +111,8 @@ ImageFrameGenerator::ImageFrameGenerator(const SkISize& fullSize,
m_isMultiFrame(isMultiFrame),
m_decodeFailed(false),
m_yuvDecodingFailed(false),
- m_frameCount(0) {}
+ m_frameCount(0),
+ m_alphaOption(ImageDecoder::AlphaPremultiplied) {}
ImageFrameGenerator::~ImageFrameGenerator() {
ImageDecodingStore::instance().removeCacheIndexedByGenerator(this);
@@ -295,8 +296,7 @@ bool ImageFrameGenerator::decode(SegmentReader* data,
*decoder = m_imageDecoderFactory->create().release();
if (!*decoder) {
- *decoder = ImageDecoder::create(data, allDataReceived,
- ImageDecoder::AlphaPremultiplied,
+ *decoder = ImageDecoder::create(data, allDataReceived, m_alphaOption,
m_decoderColorBehavior)
.release();
// The newly created decoder just grabbed the data. No need to reset it.
@@ -307,6 +307,8 @@ bool ImageFrameGenerator::decode(SegmentReader* data,
return false;
}
+ DCHECK((*decoder)->frameBufferAtIndex(index)->premultiplyAlpha() ==
msarett1 2017/04/04 23:02:36 I'm expecting the DCHECK() to warn us if we've alr
scroggo_chromium 2017/04/05 19:59:01 frameBufferAtIndex may trigger a decode, so you do
msarett1 2017/04/06 22:05:29 This all sgtm. Thanks for your thoughts.
+ (m_alphaOption == ImageDecoder::AlphaPremultiplied));
if (shouldCallSetData)
(*decoder)->setData(data, allDataReceived);

Powered by Google App Engine
This is Rietveld 408576698