diff options
author | Xavier Ducrohet <xav@android.com> | 2011-08-22 13:13:16 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-08-22 13:13:16 -0700 |
commit | 8433c36a98c9f45c37d2c60afc8a6a27514ddf2b (patch) | |
tree | 7f34f034dd8e6e354a97d9970fc4415fa697e164 /tools/layoutlib | |
parent | 110be0f1d9e66e0a40a0084db5ebc4285194a8d7 (diff) | |
download | frameworks_base-8433c36a98c9f45c37d2c60afc8a6a27514ddf2b.zip frameworks_base-8433c36a98c9f45c37d2c60afc8a6a27514ddf2b.tar.gz frameworks_base-8433c36a98c9f45c37d2c60afc8a6a27514ddf2b.tar.bz2 |
LayoutLib: add native delegate for set/getHinting in Paint.
Change-Id: I1758f8ce861240d72113aa23dcbef5a52abade56
Diffstat (limited to 'tools/layoutlib')
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java index 7777e19..e60a61c 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java @@ -82,6 +82,7 @@ public class Paint_Delegate { private float mTextSize; private float mTextScaleX; private float mTextSkewX; + private int mHintingMode = Paint.HINTING_ON; private Xfermode_Delegate mXfermode; private ColorFilter_Delegate mColorFilter; @@ -270,6 +271,28 @@ public class Paint_Delegate { } @LayoutlibDelegate + /*package*/ static int getHinting(Paint thisPaint) { + // get the delegate from the native int. + Paint_Delegate delegate = sManager.getDelegate(thisPaint.mNativePaint); + if (delegate == null) { + return Paint.HINTING_ON; + } + + return delegate.mHintingMode; + } + + @LayoutlibDelegate + /*package*/ static void setHinting(Paint thisPaint, int mode) { + // get the delegate from the native int. + Paint_Delegate delegate = sManager.getDelegate(thisPaint.mNativePaint); + if (delegate == null) { + return; + } + + delegate.mHintingMode = mode; + } + + @LayoutlibDelegate /*package*/ static void setAntiAlias(Paint thisPaint, boolean aa) { setFlag(thisPaint, Paint.ANTI_ALIAS_FLAG, aa); } @@ -1098,6 +1121,7 @@ public class Paint_Delegate { mPathEffect = paint.mPathEffect; mMaskFilter = paint.mMaskFilter; mRasterizer = paint.mRasterizer; + mHintingMode = paint.mHintingMode; updateFontObject(); } @@ -1121,6 +1145,7 @@ public class Paint_Delegate { mMaskFilter = null; mRasterizer = null; updateFontObject(); + mHintingMode = Paint.HINTING_ON; } /** |