summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-08-12 19:17:09 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-12 19:17:09 -0700
commit9beeb95c80007106f71eb355c6682cddfc8e0305 (patch)
tree0bf3eed9a7232a61b66b818ccf8b0262756e0762 /core
parent54074fe3c8ee017d024c11ba7a3f756e146b71e7 (diff)
parentf43fa5746ee5b81a6e386d36594094d079ac8160 (diff)
downloadframeworks_base-9beeb95c80007106f71eb355c6682cddfc8e0305.zip
frameworks_base-9beeb95c80007106f71eb355c6682cddfc8e0305.tar.gz
frameworks_base-9beeb95c80007106f71eb355c6682cddfc8e0305.tar.bz2
Merge "Turn off hinting by default for higher density displays."
Diffstat (limited to 'core')
-rw-r--r--core/jni/android/graphics/Paint.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 98d7fce..423eff4 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -15,6 +15,10 @@
** limitations under the License.
*/
+#define LOG_TAG "Paint"
+
+#include <utils/Log.h>
+
#include "jni.h"
#include "GraphicsJNI.h"
#include <android_runtime/AndroidRuntime.h>
@@ -50,8 +54,6 @@ static jclass gFontMetricsInt_class;
static JMetricsID gFontMetricsInt_fieldID;
static void defaultSettingsForAndroid(SkPaint* paint) {
- // looks best we decided
- paint->setHinting(SkPaint::kSlight_Hinting);
// utf16 is required for java
paint->setTextEncoding(SkPaint::kUTF16_TextEncoding);
}
@@ -96,6 +98,18 @@ public:
GraphicsJNI::getNativePaint(env, paint)->setFlags(flags);
}
+ static jint getHinting(JNIEnv* env, jobject paint) {
+ NPE_CHECK_RETURN_ZERO(env, paint);
+ return GraphicsJNI::getNativePaint(env, paint)->getHinting()
+ == SkPaint::kNo_Hinting ? 0 : 1;
+ }
+
+ static void setHinting(JNIEnv* env, jobject paint, jint mode) {
+ NPE_CHECK_RETURN_VOID(env, paint);
+ GraphicsJNI::getNativePaint(env, paint)->setHinting(
+ mode == 0 ? SkPaint::kNo_Hinting : SkPaint::kSlight_Hinting);
+ }
+
static void setAntiAlias(JNIEnv* env, jobject paint, jboolean aa) {
NPE_CHECK_RETURN_VOID(env, paint);
GraphicsJNI::getNativePaint(env, paint)->setAntiAlias(aa);
@@ -833,6 +847,8 @@ static JNINativeMethod methods[] = {
{"native_set","(II)V", (void*) SkPaintGlue::assign},
{"getFlags","()I", (void*) SkPaintGlue::getFlags},
{"setFlags","(I)V", (void*) SkPaintGlue::setFlags},
+ {"getHinting","()I", (void*) SkPaintGlue::getHinting},
+ {"setHinting","(I)V", (void*) SkPaintGlue::setHinting},
{"setAntiAlias","(Z)V", (void*) SkPaintGlue::setAntiAlias},
{"setSubpixelText","(Z)V", (void*) SkPaintGlue::setSubpixelText},
{"setLinearText","(Z)V", (void*) SkPaintGlue::setLinearText},