Fix for bug 3053078
Font gamma correction to match with lib HWUI.

Change-Id: I329a2f97058f4929b96724c9df39fbfad4243b33
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 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 @@
 
     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;