This makes it a compile error to specify both SK_GAMMA_EXPONENT
and SK_GAMMA_SRGB. It also ensures that SK_GAMMA_EXPONENT will
be set consistently.
R=djsollen@google.com, reed@google.com
Review URL: https://codereview.chromium.org/
233003003
git-svn-id: http://skia.googlecode.com/svn/trunk@14143
2bbb7eff-a529-9590-31e7-
b0007b416f81
#ifndef SkDeviceProperties_DEFINED
#define SkDeviceProperties_DEFINED
-#ifndef SK_GAMMA_EXPONENT
- #define SK_GAMMA_EXPONENT (2.2f)
-#endif
-
-#ifdef SK_GAMMA_SRGB
- #undef SK_GAMMA_EXPONENT
- #define SK_GAMMA_EXPONENT (0.0f)
-#endif
-
//TODO: get everyone to stop using SkFontLCDConfig::SetSubpixel* and remove this import.
#include "SkFontLCDConfig.h"
# endif
#endif
+
+//////////////////////////////////////////////////////////////////////
+
+#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)
+#endif
+
#endif // SkPostConfig_DEFINED