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

Unified Diff: src/codec/SkWebpCodec.cpp

Issue 1838603002: Mark webps as sRGB (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Accept any profileType Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkWebpCodec.cpp
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index a795fdd6d551637467cdf95fae5b4cffb07691d8..77af8e5e8f6fbf642e6de9678b5753de6d5f64df 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -85,9 +85,10 @@ SkCodec* SkWebpCodec::NewFromStream(SkStream* stream) {
// This version is slightly different from SkCodecPriv's version of conversion_possible. It
// supports both byte orders for 8888.
static bool webp_conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) {
- if (dst.profileType() != src.profileType()) {
- return false;
- }
+ // FIXME: skbug.com/4895
+ // Currently, we ignore the SkColorProfileType on the SkImageInfo. We
+ // will treat the encoded data as linear regardless of what the client
scroggo 2016/04/07 12:35:54 linear? I thought this CL's whole purpose was to t
msarett 2016/04/07 13:03:52 Well, we want to mark them as sRGB. I think treat
+ // requests.
if (!valid_alpha(dst.alphaType(), src.alphaType())) {
return false;
@@ -252,4 +253,6 @@ SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst,
}
SkWebpCodec::SkWebpCodec(const SkImageInfo& info, SkStream* stream)
- : INHERITED(info, stream) {}
+ // The spec says an unmarked image is sRGB, so we return that space here.
+ // TODO: Add support for parsing ICC profiles from webps.
+ : INHERITED(info, stream, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)) {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698