diff options
| author | 2021-02-26 18:39:51 +0000 | |
|---|---|---|
| committer | 2021-02-26 18:39:51 +0000 | |
| commit | 9d65c12580297117aeca5544ba0e3381908f13c9 (patch) | |
| tree | df2606ddcae56ce6ee60ea75a2b2932ed5f2e381 /graphics/java/android | |
| parent | 42b7f2b3e58d4f40923a0ed5264145639073e977 (diff) | |
| parent | 2a420c3ac51a153609491974a92a966b80c1332b (diff) | |
Merge "Add comments regarding FILTER_BITMAP_FLAG" into sc-dev
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/Paint.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index f1f9a5fc92ea..e22257071dd2 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -153,6 +153,13 @@ public class Paint { * resource bitmaps often are) the filtering will already have been * done.</p> * + * <p>On devices running {@link Build.VERSION_CODES#O} and below, hardware + * accelerated drawing always uses bilinear sampling on scaled bitmaps, + * regardless of this flag. On devices running {@link Build.VERSION_CODES#Q} + * and above, this flag defaults to being set on a new {@code Paint}. It can + * be cleared with {@link #setFlags} or {@link #setFilterBitmap}.</p> + * + * @see #Paint() * @see #Paint(int) * @see #setFlags(int) */ @@ -558,6 +565,12 @@ public class Paint { /** * Create a new paint with default settings. + * + * <p>On devices running {@link Build.VERSION_CODES#O} and below, hardware + * accelerated drawing always acts as if {@link #FILTER_BITMAP_FLAG} is set. + * On devices running {@link Build.VERSION_CODES#Q} and above, + * {@code FILTER_BITMAP_FLAG} is set by this constructor, and it can be + * cleared with {@link #setFlags} or {@link #setFilterBitmap}.</p> */ public Paint() { this(0); @@ -567,6 +580,13 @@ public class Paint { * Create a new paint with the specified flags. Use setFlags() to change * these after the paint is created. * + * <p>On devices running {@link Build.VERSION_CODES#O} and below, hardware + * accelerated drawing always acts as if {@link #FILTER_BITMAP_FLAG} is set. + * On devices running {@link Build.VERSION_CODES#Q} and above, + * {@code FILTER_BITMAP_FLAG} is always set by this constructor, regardless + * of the value of {@code flags}. It can be cleared with {@link #setFlags} or + * {@link #setFilterBitmap}.</p> + * * @param flags initial flag bits, as if they were passed via setFlags(). */ public Paint(int flags) { @@ -991,6 +1011,7 @@ public class Paint { * device pixels. That is dependent on dithering and xfermodes. * * @see #setFilterBitmap(boolean) setFilterBitmap() + * @see #FILTER_BITMAP_FLAG */ public final boolean isFilterBitmap() { return (getFlags() & FILTER_BITMAP_FLAG) != 0; @@ -1004,6 +1025,7 @@ public class Paint { * * @param filter true to set the FILTER_BITMAP_FLAG bit in the paint's * flags, false to clear it. + * @see #FILTER_BITMAP_FLAG */ public void setFilterBitmap(boolean filter) { nSetFilterBitmap(mNativePaint, filter); |