summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-04-12 17:37:44 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-12 17:37:44 -0700
commit62901af52a118c61579a81c84608c9f1118931a3 (patch)
treed2d75659a8fc09d36ff3975cd3154dc49ae11013 /core/jni/android
parentf98c8b32e87483adbfb739023ca9070559441138 (diff)
parent517825f1a9f14f92908bd7859b91b927c2eec6d9 (diff)
downloadframeworks_base-62901af52a118c61579a81c84608c9f1118931a3.zip
frameworks_base-62901af52a118c61579a81c84608c9f1118931a3.tar.gz
frameworks_base-62901af52a118c61579a81c84608c9f1118931a3.tar.bz2
Merge "Add Paint.setTextLocale()"
Diffstat (limited to 'core/jni/android')
-rw-r--r--core/jni/android/graphics/Paint.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 376c841..a65262c 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -254,6 +254,13 @@ public:
obj->setTextAlign(align);
}
+ static void setTextLocale(JNIEnv* env, jobject clazz, SkPaint* obj, jstring locale) {
+ const char* localeArray = env->GetStringUTFChars(locale, NULL);
+ SkString skLocale(localeArray);
+ obj->setTextLocale(skLocale);
+ env->ReleaseStringUTFChars(locale, localeArray);
+ }
+
static jfloat getTextSize(JNIEnv* env, jobject paint) {
NPE_CHECK_RETURN_ZERO(env, paint);
return SkScalarToFloat(GraphicsJNI::getNativePaint(env, paint)->getTextSize());
@@ -817,6 +824,7 @@ static JNINativeMethod methods[] = {
{"native_setRasterizer","(II)I", (void*) SkPaintGlue::setRasterizer},
{"native_getTextAlign","(I)I", (void*) SkPaintGlue::getTextAlign},
{"native_setTextAlign","(II)V", (void*) SkPaintGlue::setTextAlign},
+ {"native_setTextLocale","(ILjava/lang/String;)V", (void*) SkPaintGlue::setTextLocale},
{"getTextSize","()F", (void*) SkPaintGlue::getTextSize},
{"setTextSize","(F)V", (void*) SkPaintGlue::setTextSize},
{"getTextScaleX","()F", (void*) SkPaintGlue::getTextScaleX},