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

Unified Diff: src/codec/SkCodecPriv.h

Issue 2184543003: Perform color correction on png decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@colorjpegs
Patch Set: Rebase on Sk4u Created 4 years, 5 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: src/codec/SkCodecPriv.h
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h
index 6771ef72b8fe7dfabcc78af8048cbf6bffb65887..b51eb4872fcb04b907fb6f099905efc28618e973 100644
--- a/src/codec/SkCodecPriv.h
+++ b/src/codec/SkCodecPriv.h
@@ -108,7 +108,6 @@ inline bool valid_alpha(SkAlphaType dstAlpha, SkAlphaType srcAlpha) {
/*
* Most of our codecs support the same conversions:
- * - profileType must be the same
* - opaque to any alpha type
* - 565 only if opaque
* - premul to unpremul and vice versa
@@ -116,11 +115,6 @@ inline bool valid_alpha(SkAlphaType dstAlpha, SkAlphaType srcAlpha) {
* - otherwise match the src color type
*/
inline bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) {
- // 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
- // requests.
-
// Ensure the alpha type is valid
if (!valid_alpha(dst.alphaType(), src.alphaType())) {
return false;
@@ -316,4 +310,11 @@ inline PackColorProc choose_pack_color_proc(bool isPremul, SkColorType colorType
}
}
+inline bool needs_color_xform(const SkImageInfo& dstInfo, const SkImageInfo& srcInfo) {
mtklein 2016/07/29 18:48:56 All these header methods should probably be non-ex
msarett 2016/07/29 20:07:50 Done.
+ // FIXME (msarett):
+ // Do a better check for color space equality.
+ return (kRGBA_F16_SkColorType == dstInfo.colorType()) ||
+ (dstInfo.colorSpace() && (dstInfo.colorSpace() != srcInfo.colorSpace()));
+}
+
#endif // SkCodecPriv_DEFINED
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | src/codec/SkPngCodec.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698