diff options
author | Matt Sarett <msarett@google.com> | 2016-10-30 21:25:34 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-31 19:19:33 +0000 |
commit | 7f650bdfd84aa54bf4fb94a2aef89ad931578e8b (patch) | |
tree | bcb03eec2fee20a3c46c7b1bf179aebe3421f364 /src/codec/SkIcoCodec.cpp | |
parent | 4d598a35cd7a9b2bbfd724e7503840e2ad8ee778 (diff) |
Tag images as sRGB by default in SkCodec
Unmarked images should be treated as sRGB.
BUG=skia:4895
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4151
Change-Id: I5f8c308d22fd2d069cbfa89c5a5bb19ae6fde8bd
Reviewed-on: https://skia-review.googlesource.com/4151
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/codec/SkIcoCodec.cpp')
-rw-r--r-- | src/codec/SkIcoCodec.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/codec/SkIcoCodec.cpp b/src/codec/SkIcoCodec.cpp index d01904dc1b..bfbe91311a 100644 --- a/src/codec/SkIcoCodec.cpp +++ b/src/codec/SkIcoCodec.cpp @@ -171,10 +171,11 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) { int width = codecs->operator[](maxIndex)->getInfo().width(); int height = codecs->operator[](maxIndex)->getInfo().height(); SkEncodedInfo info = codecs->operator[](maxIndex)->getEncodedInfo(); + SkColorSpace* colorSpace = codecs->operator[](maxIndex)->getInfo().colorSpace(); // Note that stream is owned by the embedded codec, the ico does not need // direct access to the stream. - return new SkIcoCodec(width, height, info, codecs.release()); + return new SkIcoCodec(width, height, info, codecs.release(), sk_ref_sp(colorSpace)); } /* @@ -182,8 +183,9 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) { * Called only by NewFromStream */ SkIcoCodec::SkIcoCodec(int width, int height, const SkEncodedInfo& info, - SkTArray<SkAutoTDelete<SkCodec>, true>* codecs) - : INHERITED(width, height, info, nullptr) + SkTArray<SkAutoTDelete<SkCodec>, true>* codecs, + sk_sp<SkColorSpace> colorSpace) + : INHERITED(width, height, info, nullptr, std::move(colorSpace)) , fEmbeddedCodecs(codecs) , fCurrScanlineCodec(nullptr) , fCurrIncrementalCodec(nullptr) |