Improve comments describing common sRGB curves
authorMatt Sarett <msarett@google.com>
Thu, 27 Oct 2016 16:44:18 +0000 (12:44 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 27 Oct 2016 18:07:09 +0000 (18:07 +0000)
BUG=skia:5897

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4037

Change-Id: Id1253cc9b960aad47bc0f9b7e40f10830d46d98d
Reviewed-on: https://skia-review.googlesource.com/4037
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

src/core/SkColorSpace_ICC.cpp

index b0563c8..cba2ee1 100644 (file)
@@ -357,8 +357,8 @@ static SkGammas::Type parse_gamma(SkGammas::Data* outData, SkColorSpaceTransferF
             }
 
             if (26 == count) {
-                // The magic values were chosen because they match a very common LCMS sRGB
-                // gamma table.
+                // The magic values match a clever "minimum size" approach to representing sRGB.
+                // code.facebook.com/posts/411525055626587/under-the-hood-improving-facebook-photos
                 if (0 == read_big_endian_u16((const uint8_t*) &table[0]) &&
                         3062 == read_big_endian_u16((const uint8_t*) &table[6]) &&
                         12824 == read_big_endian_u16((const uint8_t*) &table[12]) &&
@@ -371,7 +371,7 @@ static SkGammas::Type parse_gamma(SkGammas::Data* outData, SkColorSpaceTransferF
 
             if (4096 == count) {
                 // The magic values were chosen because they match Nikon, Epson, and
-                // LCMS sRGB gamma tables (all of which use different rounding rules).
+                // lcms2 sRGB gamma tables (all of which use different rounding rules).
                 if (0 == read_big_endian_u16((const uint8_t*) &table[0]) &&
                         950 == read_big_endian_u16((const uint8_t*) &table[515]) &&
                         3342 == read_big_endian_u16((const uint8_t*) &table[1025]) &&