From 3bf3ea0d839010cc9e0e5a6bd51c325d375f679d Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Fri, 1 Oct 2010 15:20:41 -0700 Subject: Fix for bug 3053078 Font gamma correction to match with lib HWUI. Change-Id: I329a2f97058f4929b96724c9df39fbfad4243b33 --- libs/rs/rsFont.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'libs/rs/rsFont.h') diff --git a/libs/rs/rsFont.h b/libs/rs/rsFont.h index 027ed1d..16009ef 100644 --- a/libs/rs/rsFont.h +++ b/libs/rs/rsFont.h @@ -31,6 +31,15 @@ namespace android { namespace renderscript { +// Gamma (>= 1.0, <= 10.0) +#define PROPERTY_TEXT_GAMMA "ro.text_gamma" +#define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "ro.text_gamma.black_threshold" +#define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "ro.text_gamma.white_threshold" + +#define DEFAULT_TEXT_GAMMA 1.4f +#define DEFAULT_TEXT_BLACK_GAMMA_THRESHOLD 64 +#define DEFAULT_TEXT_WHITE_GAMMA_THRESHOLD 192 + class FontState; class Font : public ObjectBase @@ -162,8 +171,17 @@ protected: Context *mRSC; - float mFontColor[4]; - bool mFontColorDirty; + struct { + float mFontColor[4]; + float mGamma; + } mConstants; + bool mConstantsDirty; + + float mBlackGamma; + float mWhiteGamma; + + float mBlackThreshold; + float mWhiteThreshold; // Free type library, we only need one copy FT_Library mLibrary; -- cgit v1.1