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

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

Issue 2556723003: Merge color options into ColorBehavior (Closed)
Patch Set: Feedback Created 4 years 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 2b665bb78554b60459ac5ee544b62fec45353f66..f76ea742180f3c18f8be9ac47bf0db4609a8fd59 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -103,14 +103,11 @@ static bool updateYUVComponentSizes(ImageDecoder* decoder,
return true;
}
-ImageFrameGenerator::ImageFrameGenerator(
- const SkISize& fullSize,
- bool isMultiFrame,
- ImageDecoder::ColorSpaceOption decoderColorSpaceOption,
- sk_sp<SkColorSpace> decoderTargetColorSpace)
+ImageFrameGenerator::ImageFrameGenerator(const SkISize& fullSize,
+ bool isMultiFrame,
+ const ColorBehavior& colorBehavior)
: m_fullSize(fullSize),
- m_decoderColorSpaceOption(decoderColorSpaceOption),
- m_decoderTargetColorSpace(std::move(decoderTargetColorSpace)),
+ m_decoderColorBehavior(colorBehavior),
m_isMultiFrame(isMultiFrame),
m_decodeFailed(false),
m_yuvDecodingFailed(false),
@@ -178,8 +175,7 @@ bool ImageFrameGenerator::decodeToYUV(SegmentReader* data,
}
std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(
- data, true, ImageDecoder::AlphaPremultiplied, m_decoderColorSpaceOption,
- m_decoderTargetColorSpace);
+ data, true, ImageDecoder::AlphaPremultiplied, m_decoderColorBehavior);
// getYUVComponentSizes was already called and was successful, so
// ImageDecoder::create must succeed.
ASSERT(decoder);
@@ -299,9 +295,9 @@ bool ImageFrameGenerator::decode(SegmentReader* data,
*decoder = m_imageDecoderFactory->create().release();
if (!*decoder) {
- *decoder = ImageDecoder::create(
- data, allDataReceived, ImageDecoder::AlphaPremultiplied,
- m_decoderColorSpaceOption, m_decoderTargetColorSpace)
+ *decoder = ImageDecoder::create(data, allDataReceived,
+ ImageDecoder::AlphaPremultiplied,
+ m_decoderColorBehavior)
.release();
// The newly created decoder just grabbed the data. No need to reset it.
shouldCallSetData = false;
@@ -370,8 +366,7 @@ bool ImageFrameGenerator::getYUVComponentSizes(SegmentReader* data,
return false;
std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(
- data, true, ImageDecoder::AlphaPremultiplied, m_decoderColorSpaceOption,
- m_decoderTargetColorSpace);
+ data, true, ImageDecoder::AlphaPremultiplied, m_decoderColorBehavior);
if (!decoder)
return false;

Powered by Google App Engine
This is Rietveld 408576698