summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsFont.h
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-10-01 15:20:41 -0700
committerAlex Sakhartchouk <alexst@google.com>2010-10-01 15:20:41 -0700
commit3bf3ea0d839010cc9e0e5a6bd51c325d375f679d (patch)
treece8e58b48d84b22e90b10c37291b1b714a5e6d33 /libs/rs/rsFont.h
parentfeede2aee6fe3e721ee71ffc35b277f1d9260e03 (diff)
downloadframeworks_base-3bf3ea0d839010cc9e0e5a6bd51c325d375f679d.zip
frameworks_base-3bf3ea0d839010cc9e0e5a6bd51c325d375f679d.tar.gz
frameworks_base-3bf3ea0d839010cc9e0e5a6bd51c325d375f679d.tar.bz2
Fix for bug 3053078
Font gamma correction to match with lib HWUI. Change-Id: I329a2f97058f4929b96724c9df39fbfad4243b33
Diffstat (limited to 'libs/rs/rsFont.h')
-rw-r--r--libs/rs/rsFont.h22
1 files changed, 20 insertions, 2 deletions
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;