aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images/SkWebpEncoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/images/SkWebpEncoder.cpp')
-rw-r--r--src/images/SkWebpEncoder.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/images/SkWebpEncoder.cpp b/src/images/SkWebpEncoder.cpp
index 81ed7e1845..296d4f4cf0 100644
--- a/src/images/SkWebpEncoder.cpp
+++ b/src/images/SkWebpEncoder.cpp
@@ -194,16 +194,7 @@ bool SkWebpEncoder::Encode(SkWStream* stream, const SkPixmap& pixmap, const Opti
// If there is no need to embed an ICC profile, we write directly to the input stream.
// Otherwise, we will first encode to |tmp| and use a mux to add the ICC chunk. libwebp
// forces us to have an encoded image before we can add a profile.
- sk_sp<SkData> icc;
- if (SkColorSpace* cs = pixmap.colorSpace()) {
- sk_sp<SkColorSpace> owned;
- if (pixmap.colorType() == kRGBA_F16_SkColorType) {
- // We'll be converting to 8-bit sRGB, so we'd better tag it that way.
- owned = as_CSB(pixmap.colorSpace())->makeSRGBGamma();
- cs = owned.get();
- }
- icc = icc_from_color_space(*cs);
- }
+ sk_sp<SkData> icc = icc_from_color_space(pixmap.info());
SkDynamicMemoryWStream tmp;
pic.custom_ptr = icc ? (void*)&tmp : (void*)stream;