From 8d7f5c3f29b1ce9caaeed0e80f15eaedcf412c25 Mon Sep 17 00:00:00 2001 From: mtklein Date: Mon, 1 Aug 2016 09:22:12 -0700 Subject: [PATCH] Default fake gamma to sRGB. No one appears to be using the default 2.2. This makes SK_GAMMA_SRGB the default / a no-op, which seems more realistic. Chrome's explicitly setting SK_GAMMA_EXPONENT or SK_GAMMA_SRGB. We set Android platform explicitly to 1.4. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2198073002 Review-Url: https://codereview.chromium.org/2198073002 --- gyp/common.gypi | 3 +-- gyp/common_conditions.gypi | 8 ++------ include/core/SkPostConfig.h | 8 ++------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/gyp/common.gypi b/gyp/common.gypi index b350963..0e3e0dd 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -13,10 +13,9 @@ 'target_defaults': { 'defines': [ 'SK_INTERNAL', - 'SK_GAMMA_SRGB', 'SK_GAMMA_APPLY_TO_A8', 'QT_NO_KEYWORDS', - # The discardable resource cache is tested via a special bot. This is + # The discardable resource cache is tested via a special bot. This is # disabled here so we test the non-discardable use case. # 'SK_USE_DISCARDABLE_SCALEDIMAGECACHE', ], diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 0b3e358..65ef9ed 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -10,7 +10,7 @@ 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', 'SK_SUPPORT_GPU=<(skia_gpu)', 'SK_FORCE_DISTANCE_FIELD_TEXT=<(skia_force_distance_field_text)', - + # Indicate that all dependency libraries are present. Clients that # are missing some of the required decoding libraries may choose # not to define these. This will disable some decoder and encoder @@ -630,14 +630,10 @@ 'defines': [ 'SK_BUILD_FOR_ANDROID', - # Android Text Tuning + # Android defines a fixed text gamma exponent instead of using SRGB 'SK_GAMMA_EXPONENT=1.4', 'SK_GAMMA_CONTRAST=0.0', ], - # Android defines a fixed gamma exponent instead of using SRGB - 'defines!': [ - 'SK_GAMMA_SRGB', - ], 'configurations': { 'Release': { 'cflags': ['-O2'], diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index e44c709..fa65ee6 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -318,12 +318,8 @@ ////////////////////////////////////////////////////////////////////// -#if defined(SK_GAMMA_EXPONENT) && defined(SK_GAMMA_SRGB) -# error "cannot define both SK_GAMMA_EXPONENT and SK_GAMMA_SRGB" -#elif defined(SK_GAMMA_SRGB) -# define SK_GAMMA_EXPONENT (0.0f) -#elif !defined(SK_GAMMA_EXPONENT) -# define SK_GAMMA_EXPONENT (2.2f) +#if !defined(SK_GAMMA_EXPONENT) + #define SK_GAMMA_EXPONENT (0.0f) // SRGB #endif ////////////////////////////////////////////////////////////////////// -- 2.7.4