diff options
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 95 |
1 files changed, 72 insertions, 23 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index e493b18..0b488c9 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -1330,29 +1330,6 @@ public class Canvas { } /** - * Draw the glyphs, with origin at (x,y), using the specified paint. The - * origin is interpreted based on the Align setting in the paint. - * - * @param glyphs The glyphs to be drawn - * @param x The x-coordinate of the origin of the text being drawn - * @param y The y-coordinate of the origin of the text being drawn - * @param paint The paint used for the text (e.g. color, size, style) - * - * @hide - * - * Used only for BiDi / RTL Tests - */ - public void drawGlyphs(char[] glyphs, int index, int count, float x, float y, - Paint paint) { - if ((index | count | (index + count) | - (glyphs.length - index - count)) < 0) { - throw new IndexOutOfBoundsException(); - } - native_drawGlyphs(mNativeCanvas, glyphs, index, count, x, y, paint.mBidiFlags, - paint.mNativePaint); - } - - /** * Draw the text, with origin at (x,y), using the specified paint. The * origin is interpreted based on the Align setting in the paint. * @@ -1418,6 +1395,70 @@ public class Canvas { } /** + * Draw the text, with origin at (x,y), using the specified paint. The + * origin is interpreted based on the Align setting in the paint. + * + * @param text The text to be drawn + * @param x The x-coordinate of the origin of the text being drawn + * @param y The y-coordinate of the origin of the text being drawn + * @param paint The paint used for the text (e.g. color, size, style) + * + * @hide + * + * Used only for BiDi / RTL Tests + */ + public void drawTextWithGlyphs(char[] text, int index, int count, float x, float y, + Paint paint) { + if ((index | count | (index + count) | + (text.length - index - count)) < 0) { + throw new IndexOutOfBoundsException(); + } + native_drawTextWithGlyphs(mNativeCanvas, text, index, count, x, y, paint.mBidiFlags, + paint.mNativePaint); + } + + /** + * Draw the text, with origin at (x,y), using the specified paint. The + * origin is interpreted based on the Align setting in the paint. + * + * @param text The text to be drawn + * @param x The x-coordinate of the origin of the text being drawn + * @param y The y-coordinate of the origin of the text being drawn + * @param paint The paint used for the text (e.g. color, size, style) + * + * @hide + * + * Used only for BiDi / RTL Tests + */ + public void drawTextWithGlyphs(String text, float x, float y, Paint paint) { + native_drawTextWithGlyphs(mNativeCanvas, text, 0, text.length(), x, y, paint.mBidiFlags, + paint.mNativePaint); + } + + /** + * Draw the glyphs, with origin at (x,y), using the specified paint. The + * origin is interpreted based on the Align setting in the paint. + * + * @param glyphs The glyphs to be drawn + * @param x The x-coordinate of the origin of the text being drawn + * @param y The y-coordinate of the origin of the text being drawn + * @param paint The paint used for the text (e.g. color, size, style) + * + * @hide + * + * Used only for BiDi / RTL Tests + */ + public void drawGlyphs(char[] glyphs, int index, int count, float x, float y, + Paint paint) { + if ((index | count | (index + count) | + (glyphs.length - index - count)) < 0) { + throw new IndexOutOfBoundsException(); + } + native_drawGlyphs(mNativeCanvas, glyphs, index, count, x, y, paint.mBidiFlags, + paint.mNativePaint); + } + + /** * Render a run of all LTR or all RTL text, with shaping. This does not run * bidi on the provided text, but renders it as a uniform right-to-left or * left-to-right run, as indicated by dir. Alignment of the text is as @@ -1745,9 +1786,17 @@ public class Canvas { private static native void native_drawText(int nativeCanvas, String text, int start, int end, float x, float y, int flags, int paint); + + private static native void native_drawTextWithGlyphs(int nativeCanvas, char[] text, + int index, int count, float x, + float y, int flags, int paint); + private static native void native_drawTextWithGlyphs(int nativeCanvas, String text, + int start, int end, float x, + float y, int flags, int paint); private static native void native_drawGlyphs(int nativeCanvas, char[] glyphs, int index, int count, float x, float y, int flags, int paint); + private static native void native_drawTextRun(int nativeCanvas, String text, int start, int end, int contextStart, int contextEnd, float x, float y, int flags, int paint); |