summaryrefslogtreecommitdiff
path: root/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
commitc9fa30536fb41f0166153561388b7c42f7cb85a0 (patch)
treee8d49ca6449bde05d707d209c7d56cf8a467f238 /rsFont.h
parent889fe50e7aaebed8cb8284b16a0e51e64e8a3a9c (diff)
downloadrs-c9fa30536fb41f0166153561388b7c42f7cb85a0.tar.gz
Fix for bug 3053078
Font gamma correction to match with lib HWUI. Change-Id: I329a2f97058f4929b96724c9df39fbfad4243b33
Diffstat (limited to 'rsFont.h')
-rw-r--r--rsFont.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/rsFont.h b/rsFont.h
index 027ed1d9..16009eff 100644
--- a/rsFont.h
+++ b/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;