diff options
author | Chris Craik <ccraik@google.com> | 2015-04-24 10:46:46 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-04-27 18:11:57 +0000 |
commit | 1b60cc0529161b5eca6407b551d67d355994c567 (patch) | |
tree | b7c88b82712f55193680e685572df3180833b62f /graphics | |
parent | 580c30a63353f67433da25ef7b90913300e0372f (diff) | |
download | frameworks_base-1b60cc0529161b5eca6407b551d67d355994c567.zip frameworks_base-1b60cc0529161b5eca6407b551d67d355994c567.tar.gz frameworks_base-1b60cc0529161b5eca6407b551d67d355994c567.tar.bz2 |
Anti-alias by default
Change-Id: I19434717dd3af4fdcffbfcca2ffbb485dfebe644
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Paint.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index 649d996..ce2448f 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -184,8 +184,12 @@ public class Paint { /** @hide bit mask for the flag enabling vertical rendering for text */ public static final int VERTICAL_TEXT_FLAG = 0x1000; - // we use this when we first create a paint - static final int DEFAULT_PAINT_FLAGS = DEV_KERN_TEXT_FLAG | EMBEDDED_BITMAP_TEXT_FLAG; + + /** @hide default flags, even if unspecified */ + public static final int HIDDEN_DEFAULT_PAINT_FLAGS = + DEV_KERN_TEXT_FLAG | EMBEDDED_BITMAP_TEXT_FLAG; + /** @hide default flags for no-param constructor */ + public static final int DEFAULT_PAINT_FLAGS = ANTI_ALIAS_FLAG; /** * Font hinter option that disables font hinting. @@ -415,9 +419,11 @@ public class Paint { /** * Create a new paint with default settings. + * + * As of {@link android.os.Build.VERSION_CODES#MNC}, sets {@link #ANTI_ALIAS_FLAG}. */ public Paint() { - this(0); + this(DEFAULT_PAINT_FLAGS); } /** @@ -428,7 +434,7 @@ public class Paint { */ public Paint(int flags) { mNativePaint = native_init(); - setFlags(flags | DEFAULT_PAINT_FLAGS); + setFlags(flags | HIDDEN_DEFAULT_PAINT_FLAGS); // TODO: Turning off hinting has undesirable side effects, we need to // revisit hinting once we add support for subpixel positioning // setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV @@ -452,7 +458,7 @@ public class Paint { /** Restores the paint to its default settings. */ public void reset() { native_reset(mNativePaint); - setFlags(DEFAULT_PAINT_FLAGS); + setFlags(DEFAULT_PAINT_FLAGS | HIDDEN_DEFAULT_PAINT_FLAGS); // TODO: Turning off hinting has undesirable side effects, we need to // revisit hinting once we add support for subpixel positioning @@ -1870,7 +1876,7 @@ public class Paint { * Convenience overload that takes a char array instead of a * String. * - * @see #getTextRunAdvances(String, int, int, int, int, int, float[], int) + * @see #getTextRunAdvances(String, int, int, int, int, boolean, float[], int) * @hide */ public float getTextRunAdvances(char[] chars, int index, int count, @@ -1915,7 +1921,7 @@ public class Paint { * Convenience overload that takes a CharSequence instead of a * String. * - * @see #getTextRunAdvances(String, int, int, int, int, int, float[], int) + * @see #getTextRunAdvances(String, int, int, int, int, boolean, float[], int) * @hide */ public float getTextRunAdvances(CharSequence text, int start, int end, |