From 6a23f4bf10dc86ebb80b1d09441f035e8e2a1014 Mon Sep 17 00:00:00 2001 From: Nolan Scobie Date: Thu, 3 Nov 2022 14:00:41 -0400 Subject: docs: Note that antialiasing is not supported on multiple Canvas draw ops Fixes: 240457136 Test: Manually checked pages built from ABTD run Change-Id: I024959a5d9bc74a1a45dfe65245f8952ad18c236 --- graphics/java/android/graphics/Canvas.java | 23 ++++++++++++++++++----- graphics/java/android/graphics/Paint.java | 7 +++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index abf7e9911086..42c892a240b6 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -1667,6 +1667,9 @@ public class Canvas extends BaseCanvas { * effectively treating them as zeros. In API level {@value Build.VERSION_CODES#P} and above * these parameters will be respected. * + *

Note: antialiasing is not supported, therefore {@link Paint#ANTI_ALIAS_FLAG} is + * ignored.

+ * * @param bitmap The bitmap to draw using the mesh * @param meshWidth The number of columns in the mesh. Nothing is drawn if this is 0 * @param meshHeight The number of rows in the mesh. Nothing is drawn if this is 0 @@ -1678,7 +1681,7 @@ public class Canvas extends BaseCanvas { * null, there must be at least (meshWidth+1) * (meshHeight+1) + colorOffset values * in the array. * @param colorOffset Number of color elements to skip before drawing - * @param paint May be null. The paint used to draw the bitmap + * @param paint May be null. The paint used to draw the bitmap. Antialiasing is not supported. */ public void drawBitmapMesh(@NonNull Bitmap bitmap, int meshWidth, int meshHeight, @NonNull float[] verts, int vertOffset, @Nullable int[] colors, int colorOffset, @@ -1832,9 +1835,12 @@ public class Canvas extends BaseCanvas { /** * Draws the specified bitmap as an N-patch (most often, a 9-patch.) * + *

Note: antialiasing is not supported, therefore {@link Paint#ANTI_ALIAS_FLAG} is + * ignored.

+ * * @param patch The ninepatch object to render * @param dst The destination rectangle. - * @param paint The paint to draw the bitmap with. may be null + * @param paint The paint to draw the bitmap with. May be null. Antialiasing is not supported. */ public void drawPatch(@NonNull NinePatch patch, @NonNull Rect dst, @Nullable Paint paint) { super.drawPatch(patch, dst, paint); @@ -1843,9 +1849,12 @@ public class Canvas extends BaseCanvas { /** * Draws the specified bitmap as an N-patch (most often, a 9-patch.) * + *

Note: antialiasing is not supported, therefore {@link Paint#ANTI_ALIAS_FLAG} is + * ignored.

+ * * @param patch The ninepatch object to render * @param dst The destination rectangle. - * @param paint The paint to draw the bitmap with. may be null + * @param paint The paint to draw the bitmap with. May be null. Antialiasing is not supported. */ public void drawPatch(@NonNull NinePatch patch, @NonNull RectF dst, @Nullable Paint paint) { super.drawPatch(patch, dst, paint); @@ -2278,6 +2287,9 @@ public class Canvas extends BaseCanvas { * array is optional, but if it is present, then it is used to specify the index of each * triangle, rather than just walking through the arrays in order. * + *

Note: antialiasing is not supported, therefore {@link Paint#ANTI_ALIAS_FLAG} is + * ignored.

+ * * @param mode How to interpret the array of vertices * @param vertexCount The number of values in the vertices array (and corresponding texs and * colors arrays if non-null). Each logical vertex is two values (x, y), vertexCount @@ -2292,8 +2304,9 @@ public class Canvas extends BaseCanvas { * @param colorOffset Number of values in colors to skip before drawing. * @param indices If not null, array of indices to reference into the vertex (texs, colors) * array. - * @param indexCount number of entries in the indices array (if not null). - * @param paint Specifies the shader to use if the texs array is non-null. + * @param indexCount Number of entries in the indices array (if not null). + * @param paint Specifies the shader to use if the texs array is non-null. Antialiasing is not + * supported. */ public void drawVertices(@NonNull VertexMode mode, int vertexCount, @NonNull float[] verts, int vertOffset, @Nullable float[] texs, int texOffset, @Nullable int[] colors, diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index 451b99ea7550..f438a03b1434 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -137,6 +137,13 @@ public class Paint { *

Enabling this flag will cause all draw operations that support * antialiasing to use it.

* + *

Notable draw operations that do not support antialiasing include:

+ * + * * @see #Paint(int) * @see #setFlags(int) */ -- cgit v1.2.3-59-g8ed1b