Rename native methods that were changed in the platform
This is following commitsf22859757b,94931bd87e,4387190d8eandcaa08ff5e9. Test: Run TestDelegates Change-Id: If90028492c036fc5f69913e4dcad5a1a5fca4b55
This commit is contained in:
@@ -326,7 +326,7 @@ public final class Bitmap_Delegate {
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nativeReconfigure(long nativeBitmap, int width, int height,
|
||||
int config, int allocSize, boolean isPremultiplied) {
|
||||
int config, boolean isPremultiplied) {
|
||||
Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED,
|
||||
"Bitmap.reconfigure() is not supported", null /*data*/);
|
||||
}
|
||||
@@ -600,6 +600,22 @@ public final class Bitmap_Delegate {
|
||||
return Arrays.equals(argb1, argb2);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nativeGetAllocationByteCount(long nativeBitmap) {
|
||||
// get the delegate from the native int.
|
||||
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
|
||||
if (delegate == null) {
|
||||
return 0;
|
||||
}
|
||||
return nativeRowBytes(nativeBitmap) * delegate.mImage.getHeight();
|
||||
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nativePrepareToDraw(long nativeBitmap) {
|
||||
// do nothing as Bitmap_Delegate does not have caches
|
||||
}
|
||||
|
||||
// ---- Private delegate/helper methods ----
|
||||
|
||||
private Bitmap_Delegate(BufferedImage image, Config config) {
|
||||
|
||||
@@ -110,17 +110,17 @@ public final class Canvas_Delegate {
|
||||
// ---- native methods ----
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void freeCaches() {
|
||||
/*package*/ static void nFreeCaches() {
|
||||
// nothing to be done here.
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void freeTextLayoutCaches() {
|
||||
/*package*/ static void nFreeTextLayoutCaches() {
|
||||
// nothing to be done here yet.
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static long initRaster(@Nullable Bitmap bitmap) {
|
||||
/*package*/ static long nInitRaster(@Nullable Bitmap bitmap) {
|
||||
long nativeBitmapOrZero = 0;
|
||||
if (bitmap != null) {
|
||||
nativeBitmapOrZero = bitmap.getNativeInstance();
|
||||
@@ -142,7 +142,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_setBitmap(long canvas, Bitmap bitmap) {
|
||||
public static void nSetBitmap(long canvas, Bitmap bitmap) {
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas);
|
||||
Bitmap_Delegate bitmapDelegate = Bitmap_Delegate.getDelegate(bitmap);
|
||||
if (canvasDelegate == null || bitmapDelegate==null) {
|
||||
@@ -153,7 +153,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_isOpaque(long nativeCanvas) {
|
||||
public static boolean nIsOpaque(long nativeCanvas) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -164,10 +164,10 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_setHighContrastText(long nativeCanvas, boolean highContrastText){}
|
||||
public static void nSetHighContrastText(long nativeCanvas, boolean highContrastText){}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static int native_getWidth(long nativeCanvas) {
|
||||
public static int nGetWidth(long nativeCanvas) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -178,7 +178,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static int native_getHeight(long nativeCanvas) {
|
||||
public static int nGetHeight(long nativeCanvas) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -189,7 +189,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static int native_save(long nativeCanvas, int saveFlags) {
|
||||
public static int nSave(long nativeCanvas, int saveFlags) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -200,7 +200,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static int native_saveLayer(long nativeCanvas, float l,
|
||||
public static int nSaveLayer(long nativeCanvas, float l,
|
||||
float t, float r, float b,
|
||||
long paint, int layerFlags) {
|
||||
// get the delegate from the native int.
|
||||
@@ -219,7 +219,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static int native_saveLayerAlpha(long nativeCanvas, float l,
|
||||
public static int nSaveLayerAlpha(long nativeCanvas, float l,
|
||||
float t, float r, float b,
|
||||
int alpha, int layerFlags) {
|
||||
// get the delegate from the native int.
|
||||
@@ -232,7 +232,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_restore(long nativeCanvas, boolean throwOnUnderflow) {
|
||||
public static void nRestore(long nativeCanvas, boolean throwOnUnderflow) {
|
||||
// FIXME: implement throwOnUnderflow.
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
@@ -244,7 +244,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_restoreToCount(long nativeCanvas, int saveCount,
|
||||
public static void nRestoreToCount(long nativeCanvas, int saveCount,
|
||||
boolean throwOnUnderflow) {
|
||||
// FIXME: implement throwOnUnderflow.
|
||||
// get the delegate from the native int.
|
||||
@@ -257,7 +257,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static int native_getSaveCount(long nativeCanvas) {
|
||||
public static int nGetSaveCount(long nativeCanvas) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -268,7 +268,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_translate(long nativeCanvas, float dx, float dy) {
|
||||
public static void nTranslate(long nativeCanvas, float dx, float dy) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -279,7 +279,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_scale(long nativeCanvas, float sx, float sy) {
|
||||
public static void nScale(long nativeCanvas, float sx, float sy) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -290,7 +290,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_rotate(long nativeCanvas, float degrees) {
|
||||
public static void nRotate(long nativeCanvas, float degrees) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -301,7 +301,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_skew(long nativeCanvas, float kx, float ky) {
|
||||
public static void nSkew(long nativeCanvas, float kx, float ky) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -325,7 +325,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_concat(long nCanvas, long nMatrix) {
|
||||
public static void nConcat(long nCanvas, long nMatrix) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -353,7 +353,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_setMatrix(long nCanvas, long nMatrix) {
|
||||
public static void nSetMatrix(long nCanvas, long nMatrix) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -383,7 +383,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_clipRect(long nCanvas,
|
||||
public static boolean nClipRect(long nCanvas,
|
||||
float left, float top,
|
||||
float right, float bottom,
|
||||
int regionOp) {
|
||||
@@ -397,7 +397,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_clipPath(long nativeCanvas,
|
||||
public static boolean nClipPath(long nativeCanvas,
|
||||
long nativePath,
|
||||
int regionOp) {
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
@@ -414,7 +414,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_clipRegion(long nativeCanvas,
|
||||
public static boolean nClipRegion(long nativeCanvas,
|
||||
long nativeRegion,
|
||||
int regionOp) {
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
@@ -431,7 +431,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void nativeSetDrawFilter(long nativeCanvas, long nativeFilter) {
|
||||
public static void nSetDrawFilter(long nativeCanvas, long nativeFilter) {
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
return;
|
||||
@@ -446,7 +446,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_getClipBounds(long nativeCanvas,
|
||||
public static boolean nGetClipBounds(long nativeCanvas,
|
||||
Rect bounds) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
@@ -467,7 +467,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_getCTM(long canvas, long matrix) {
|
||||
public static void nGetCTM(long canvas, long matrix) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -484,13 +484,13 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_quickReject(long nativeCanvas, long path) {
|
||||
public static boolean nQuickReject(long nativeCanvas, long path) {
|
||||
// FIXME properly implement quickReject
|
||||
return false;
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static boolean native_quickReject(long nativeCanvas,
|
||||
public static boolean nQuickReject(long nativeCanvas,
|
||||
float left, float top,
|
||||
float right, float bottom) {
|
||||
// FIXME properly implement quickReject
|
||||
@@ -498,7 +498,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawColor(long nativeCanvas, final int color, final int mode) {
|
||||
public static void nDrawColor(long nativeCanvas, final int color, final int mode) {
|
||||
// get the delegate from the native int.
|
||||
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
|
||||
if (canvasDelegate == null) {
|
||||
@@ -529,14 +529,14 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawPaint(long nativeCanvas, long paint) {
|
||||
public static void nDrawPaint(long nativeCanvas, long paint) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
"Canvas.drawPaint is not supported.", null, null /*data*/);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawPoint(long nativeCanvas, float x, float y,
|
||||
public static void nDrawPoint(long nativeCanvas, float x, float y,
|
||||
long nativePaint) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
@@ -544,7 +544,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawPoints(long nativeCanvas, float[] pts, int offset, int count,
|
||||
public static void nDrawPoints(long nativeCanvas, float[] pts, int offset, int count,
|
||||
long nativePaint) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
@@ -552,7 +552,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawLine(long nativeCanvas,
|
||||
public static void nDrawLine(long nativeCanvas,
|
||||
final float startX, final float startY, final float stopX, final float stopY,
|
||||
long paint) {
|
||||
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
|
||||
@@ -565,7 +565,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawLines(long nativeCanvas,
|
||||
public static void nDrawLines(long nativeCanvas,
|
||||
final float[] pts, final int offset, final int count,
|
||||
long nativePaint) {
|
||||
draw(nativeCanvas, nativePaint, false /*compositeOnly*/,
|
||||
@@ -581,7 +581,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawRect(long nativeCanvas,
|
||||
public static void nDrawRect(long nativeCanvas,
|
||||
final float left, final float top, final float right, final float bottom, long paint) {
|
||||
|
||||
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
|
||||
@@ -607,7 +607,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawOval(long nativeCanvas, final float left,
|
||||
public static void nDrawOval(long nativeCanvas, final float left,
|
||||
final float top, final float right, final float bottom, long paint) {
|
||||
if (right > left && bottom > top) {
|
||||
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
|
||||
@@ -634,15 +634,15 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawCircle(long nativeCanvas,
|
||||
public static void nDrawCircle(long nativeCanvas,
|
||||
float cx, float cy, float radius, long paint) {
|
||||
native_drawOval(nativeCanvas,
|
||||
nDrawOval(nativeCanvas,
|
||||
cx - radius, cy - radius, cx + radius, cy + radius,
|
||||
paint);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawArc(long nativeCanvas,
|
||||
public static void nDrawArc(long nativeCanvas,
|
||||
final float left, final float top, final float right, final float bottom,
|
||||
final float startAngle, final float sweep,
|
||||
final boolean useCenter, long paint) {
|
||||
@@ -674,7 +674,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawRoundRect(long nativeCanvas,
|
||||
public static void nDrawRoundRect(long nativeCanvas,
|
||||
final float left, final float top, final float right, final float bottom,
|
||||
final float rx, final float ry, long paint) {
|
||||
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
|
||||
@@ -704,7 +704,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawPath(long nativeCanvas, long path, long paint) {
|
||||
public static void nDrawPath(long nativeCanvas, long path, long paint) {
|
||||
final Path_Delegate pathDelegate = Path_Delegate.getDelegate(path);
|
||||
if (pathDelegate == null) {
|
||||
return;
|
||||
@@ -756,7 +756,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawRegion(long nativeCanvas, long nativeRegion,
|
||||
public static void nDrawRegion(long nativeCanvas, long nativeRegion,
|
||||
long nativePaint) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
@@ -764,7 +764,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawNinePatch(Canvas thisCanvas, long nativeCanvas,
|
||||
public static void nDrawNinePatch(Canvas thisCanvas, long nativeCanvas,
|
||||
long nativeBitmap, long ninePatch, final float dstLeft, final float dstTop,
|
||||
final float dstRight, final float dstBottom, long nativePaintOrZero,
|
||||
final int screenDensity, final int bitmapDensity) {
|
||||
@@ -811,7 +811,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap,
|
||||
public static void nDrawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap,
|
||||
float left, float top,
|
||||
long nativePaintOrZero,
|
||||
int canvasDensity,
|
||||
@@ -833,7 +833,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap,
|
||||
public static void nDrawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap,
|
||||
float srcLeft, float srcTop, float srcRight, float srcBottom,
|
||||
float dstLeft, float dstTop, float dstRight, float dstBottom,
|
||||
long nativePaintOrZero, int screenDensity, int bitmapDensity) {
|
||||
@@ -849,7 +849,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawBitmap(long nativeCanvas, int[] colors,
|
||||
public static void nDrawBitmap(long nativeCanvas, int[] colors,
|
||||
int offset, int stride, final float x,
|
||||
final float y, int width, int height,
|
||||
boolean hasAlpha,
|
||||
@@ -936,25 +936,25 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawText(long nativeCanvas, char[] text, int index, int count,
|
||||
public static void nDrawText(long nativeCanvas, char[] text, int index, int count,
|
||||
float startX, float startY, int flags, long paint, long typeface) {
|
||||
drawText(nativeCanvas, text, index, count, startX, startY, (flags & 1) != 0,
|
||||
paint, typeface);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawText(long nativeCanvas, String text,
|
||||
public static void nDrawText(long nativeCanvas, String text,
|
||||
int start, int end, float x, float y, final int flags, long paint,
|
||||
long typeface) {
|
||||
int count = end - start;
|
||||
char[] buffer = TemporaryBuffer.obtain(count);
|
||||
TextUtils.getChars(text, start, end, buffer, 0);
|
||||
|
||||
native_drawText(nativeCanvas, buffer, 0, count, x, y, flags, paint, typeface);
|
||||
nDrawText(nativeCanvas, buffer, 0, count, x, y, flags, paint, typeface);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawTextRun(long nativeCanvas, String text,
|
||||
public static void nDrawTextRun(long nativeCanvas, String text,
|
||||
int start, int end, int contextStart, int contextEnd,
|
||||
float x, float y, boolean isRtl, long paint, long typeface) {
|
||||
int count = end - start;
|
||||
@@ -965,14 +965,14 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawTextRun(long nativeCanvas, char[] text,
|
||||
public static void nDrawTextRun(long nativeCanvas, char[] text,
|
||||
int start, int count, int contextStart, int contextCount,
|
||||
float x, float y, boolean isRtl, long paint, long typeface) {
|
||||
drawText(nativeCanvas, text, start, count, x, y, isRtl, paint, typeface);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawTextOnPath(long nativeCanvas,
|
||||
public static void nDrawTextOnPath(long nativeCanvas,
|
||||
char[] text, int index,
|
||||
int count, long path,
|
||||
float hOffset,
|
||||
@@ -984,7 +984,7 @@ public final class Canvas_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
public static void native_drawTextOnPath(long nativeCanvas,
|
||||
public static void nDrawTextOnPath(long nativeCanvas,
|
||||
String text, long path,
|
||||
float hOffset,
|
||||
float vOffset,
|
||||
|
||||
@@ -27,6 +27,8 @@ import android.graphics.Matrix.ScaleToFit;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.NoninvertibleTransformException;
|
||||
|
||||
import libcore.util.NativeAllocationRegistry_Delegate;
|
||||
|
||||
/**
|
||||
* Delegate implementing the native methods of android.graphics.Matrix
|
||||
*
|
||||
@@ -47,6 +49,7 @@ public final class Matrix_Delegate {
|
||||
// ---- delegate manager ----
|
||||
private static final DelegateManager<Matrix_Delegate> sManager =
|
||||
new DelegateManager<Matrix_Delegate>(Matrix_Delegate.class);
|
||||
private static long sFinalizer = -1;
|
||||
|
||||
// ---- delegate data ----
|
||||
private float mValues[] = new float[MATRIX_SIZE];
|
||||
@@ -174,7 +177,7 @@ public final class Matrix_Delegate {
|
||||
// ---- native methods ----
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static long native_create(long native_src_or_zero) {
|
||||
/*package*/ static long nCreate(long native_src_or_zero) {
|
||||
// create the delegate
|
||||
Matrix_Delegate newDelegate = new Matrix_Delegate();
|
||||
|
||||
@@ -193,7 +196,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_isIdentity(long native_object) {
|
||||
/*package*/ static boolean nIsIdentity(long native_object) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return false;
|
||||
@@ -203,7 +206,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_isAffine(long native_object) {
|
||||
/*package*/ static boolean nIsAffine(long native_object) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return true;
|
||||
@@ -213,7 +216,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_rectStaysRect(long native_object) {
|
||||
/*package*/ static boolean nRectStaysRect(long native_object) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return true;
|
||||
@@ -223,7 +226,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_reset(long native_object) {
|
||||
/*package*/ static void nReset(long native_object) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -233,7 +236,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_set(long native_object, long other) {
|
||||
/*package*/ static void nSet(long native_object, long other) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -248,7 +251,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setTranslate(long native_object, float dx, float dy) {
|
||||
/*package*/ static void nSetTranslate(long native_object, float dx, float dy) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -258,7 +261,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setScale(long native_object, float sx, float sy,
|
||||
/*package*/ static void nSetScale(long native_object, float sx, float sy,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
@@ -269,7 +272,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setScale(long native_object, float sx, float sy) {
|
||||
/*package*/ static void nSetScale(long native_object, float sx, float sy) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -287,7 +290,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setRotate(long native_object, float degrees, float px, float py) {
|
||||
/*package*/ static void nSetRotate(long native_object, float degrees, float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -297,7 +300,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setRotate(long native_object, float degrees) {
|
||||
/*package*/ static void nSetRotate(long native_object, float degrees) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -307,7 +310,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setSinCos(long native_object, float sinValue, float cosValue,
|
||||
/*package*/ static void nSetSinCos(long native_object, float sinValue, float cosValue,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
@@ -326,7 +329,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setSinCos(long native_object, float sinValue, float cosValue) {
|
||||
/*package*/ static void nSetSinCos(long native_object, float sinValue, float cosValue) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -336,7 +339,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setSkew(long native_object, float kx, float ky,
|
||||
/*package*/ static void nSetSkew(long native_object, float kx, float ky,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
@@ -347,7 +350,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setSkew(long native_object, float kx, float ky) {
|
||||
/*package*/ static void nSetSkew(long native_object, float kx, float ky) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -365,12 +368,12 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setConcat(long native_object, long a, long b) {
|
||||
/*package*/ static void nSetConcat(long native_object, long a, long b) {
|
||||
if (a == native_object) {
|
||||
native_preConcat(native_object, b);
|
||||
nPreConcat(native_object, b);
|
||||
return;
|
||||
} else if (b == native_object) {
|
||||
native_postConcat(native_object, a);
|
||||
nPostConcat(native_object, a);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -383,7 +386,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preTranslate(long native_object, float dx, float dy) {
|
||||
/*package*/ static void nPreTranslate(long native_object, float dx, float dy) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.preTransform(getTranslate(dx, dy));
|
||||
@@ -391,7 +394,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preScale(long native_object, float sx, float sy,
|
||||
/*package*/ static void nPreScale(long native_object, float sx, float sy,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
@@ -400,7 +403,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preScale(long native_object, float sx, float sy) {
|
||||
/*package*/ static void nPreScale(long native_object, float sx, float sy) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.preTransform(getScale(sx, sy));
|
||||
@@ -408,7 +411,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preRotate(long native_object, float degrees,
|
||||
/*package*/ static void nPreRotate(long native_object, float degrees,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
@@ -417,7 +420,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preRotate(long native_object, float degrees) {
|
||||
/*package*/ static void nPreRotate(long native_object, float degrees) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
|
||||
@@ -430,7 +433,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preSkew(long native_object, float kx, float ky,
|
||||
/*package*/ static void nPreSkew(long native_object, float kx, float ky,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
@@ -439,7 +442,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preSkew(long native_object, float kx, float ky) {
|
||||
/*package*/ static void nPreSkew(long native_object, float kx, float ky) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.preTransform(getSkew(kx, ky));
|
||||
@@ -447,7 +450,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_preConcat(long native_object, long other_matrix) {
|
||||
/*package*/ static void nPreConcat(long native_object, long other_matrix) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
Matrix_Delegate other = sManager.getDelegate(other_matrix);
|
||||
if (d != null && other != null) {
|
||||
@@ -456,7 +459,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postTranslate(long native_object, float dx, float dy) {
|
||||
/*package*/ static void nPostTranslate(long native_object, float dx, float dy) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.postTransform(getTranslate(dx, dy));
|
||||
@@ -464,7 +467,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postScale(long native_object, float sx, float sy,
|
||||
/*package*/ static void nPostScale(long native_object, float sx, float sy,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
@@ -473,7 +476,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postScale(long native_object, float sx, float sy) {
|
||||
/*package*/ static void nPostScale(long native_object, float sx, float sy) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.postTransform(getScale(sx, sy));
|
||||
@@ -481,7 +484,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postRotate(long native_object, float degrees,
|
||||
/*package*/ static void nPostRotate(long native_object, float degrees,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
@@ -490,7 +493,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postRotate(long native_object, float degrees) {
|
||||
/*package*/ static void nPostRotate(long native_object, float degrees) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.postTransform(getRotate(degrees));
|
||||
@@ -498,7 +501,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postSkew(long native_object, float kx, float ky,
|
||||
/*package*/ static void nPostSkew(long native_object, float kx, float ky,
|
||||
float px, float py) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
@@ -507,7 +510,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postSkew(long native_object, float kx, float ky) {
|
||||
/*package*/ static void nPostSkew(long native_object, float kx, float ky) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d != null) {
|
||||
d.postTransform(getSkew(kx, ky));
|
||||
@@ -515,7 +518,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_postConcat(long native_object, long other_matrix) {
|
||||
/*package*/ static void nPostConcat(long native_object, long other_matrix) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
Matrix_Delegate other = sManager.getDelegate(other_matrix);
|
||||
if (d != null && other != null) {
|
||||
@@ -524,7 +527,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_setRectToRect(long native_object, RectF src,
|
||||
/*package*/ static boolean nSetRectToRect(long native_object, RectF src,
|
||||
RectF dst, int stf) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
@@ -589,7 +592,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_setPolyToPoly(long native_object, float[] src, int srcIndex,
|
||||
/*package*/ static boolean nSetPolyToPoly(long native_object, float[] src, int srcIndex,
|
||||
float[] dst, int dstIndex, int pointCount) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
@@ -599,7 +602,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_invert(long native_object, long inverse) {
|
||||
/*package*/ static boolean nInvert(long native_object, long inverse) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return false;
|
||||
@@ -627,7 +630,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_mapPoints(long native_object, float[] dst, int dstIndex,
|
||||
/*package*/ static void nMapPoints(long native_object, float[] dst, int dstIndex,
|
||||
float[] src, int srcIndex, int ptCount, boolean isPts) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
@@ -642,7 +645,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_mapRect(long native_object, RectF dst, RectF src) {
|
||||
/*package*/ static boolean nMapRect(long native_object, RectF dst, RectF src) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return false;
|
||||
@@ -652,7 +655,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float native_mapRadius(long native_object, float radius) {
|
||||
/*package*/ static float nMapRadius(long native_object, float radius) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return 0.f;
|
||||
@@ -667,7 +670,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_getValues(long native_object, float[] values) {
|
||||
/*package*/ static void nGetValues(long native_object, float[] values) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -677,7 +680,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void native_setValues(long native_object, float[] values) {
|
||||
/*package*/ static void nSetValues(long native_object, float[] values) {
|
||||
Matrix_Delegate d = sManager.getDelegate(native_object);
|
||||
if (d == null) {
|
||||
return;
|
||||
@@ -687,7 +690,7 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean native_equals(long native_a, long native_b) {
|
||||
/*package*/ static boolean nEquals(long native_a, long native_b) {
|
||||
Matrix_Delegate a = sManager.getDelegate(native_a);
|
||||
if (a == null) {
|
||||
return false;
|
||||
@@ -708,8 +711,13 @@ public final class Matrix_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void finalizer(long native_instance) {
|
||||
sManager.removeJavaReferenceFor(native_instance);
|
||||
/*package*/ static long nGetNativeFinalizer() {
|
||||
synchronized (Matrix_Delegate.class) {
|
||||
if (sFinalizer == -1) {
|
||||
sFinalizer = NativeAllocationRegistry_Delegate.createFinalizer(sManager::removeJavaReferenceFor);
|
||||
}
|
||||
}
|
||||
return sFinalizer;
|
||||
}
|
||||
|
||||
// ---- Private helper methods ----
|
||||
|
||||
@@ -261,7 +261,7 @@ public class Paint_Delegate {
|
||||
// ---- native methods ----
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetFlags(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static int nGetFlags(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -274,7 +274,7 @@ public class Paint_Delegate {
|
||||
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetFlags(Paint thisPaint, long nativePaint, int flags) {
|
||||
/*package*/ static void nSetFlags(long nativePaint, int flags) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -285,12 +285,12 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetFilterBitmap(Paint thisPaint, long nativePaint, boolean filter) {
|
||||
/*package*/ static void nSetFilterBitmap(long nativePaint, boolean filter) {
|
||||
setFlag(nativePaint, Paint.FILTER_BITMAP_FLAG, filter);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetHinting(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static int nGetHinting(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -301,7 +301,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetHinting(Paint thisPaint, long nativePaint, int mode) {
|
||||
/*package*/ static void nSetHinting(long nativePaint, int mode) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -312,46 +312,46 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetAntiAlias(Paint thisPaint, long nativePaint, boolean aa) {
|
||||
/*package*/ static void nSetAntiAlias(long nativePaint, boolean aa) {
|
||||
setFlag(nativePaint, Paint.ANTI_ALIAS_FLAG, aa);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetSubpixelText(Paint thisPaint, long nativePaint,
|
||||
/*package*/ static void nSetSubpixelText(long nativePaint,
|
||||
boolean subpixelText) {
|
||||
setFlag(nativePaint, Paint.SUBPIXEL_TEXT_FLAG, subpixelText);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetUnderlineText(Paint thisPaint, long nativePaint,
|
||||
/*package*/ static void nSetUnderlineText(long nativePaint,
|
||||
boolean underlineText) {
|
||||
setFlag(nativePaint, Paint.UNDERLINE_TEXT_FLAG, underlineText);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetStrikeThruText(Paint thisPaint, long nativePaint,
|
||||
/*package*/ static void nSetStrikeThruText(long nativePaint,
|
||||
boolean strikeThruText) {
|
||||
setFlag(nativePaint, Paint.STRIKE_THRU_TEXT_FLAG, strikeThruText);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetFakeBoldText(Paint thisPaint, long nativePaint,
|
||||
/*package*/ static void nSetFakeBoldText(long nativePaint,
|
||||
boolean fakeBoldText) {
|
||||
setFlag(nativePaint, Paint.FAKE_BOLD_TEXT_FLAG, fakeBoldText);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetDither(Paint thisPaint, long nativePaint, boolean dither) {
|
||||
/*package*/ static void nSetDither(long nativePaint, boolean dither) {
|
||||
setFlag(nativePaint, Paint.DITHER_FLAG, dither);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetLinearText(Paint thisPaint, long nativePaint, boolean linearText) {
|
||||
/*package*/ static void nSetLinearText(long nativePaint, boolean linearText) {
|
||||
setFlag(nativePaint, Paint.LINEAR_TEXT_FLAG, linearText);
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetColor(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static int nGetColor(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -362,7 +362,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetColor(Paint thisPaint, long nativePaint, int color) {
|
||||
/*package*/ static void nSetColor(long nativePaint, int color) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -373,7 +373,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetAlpha(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static int nGetAlpha(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -384,7 +384,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetAlpha(Paint thisPaint, long nativePaint, int a) {
|
||||
/*package*/ static void nSetAlpha(long nativePaint, int a) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -395,7 +395,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nGetStrokeWidth(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static float nGetStrokeWidth(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -406,7 +406,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetStrokeWidth(Paint thisPaint, long nativePaint, float width) {
|
||||
/*package*/ static void nSetStrokeWidth(long nativePaint, float width) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -417,7 +417,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nGetStrokeMiter(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static float nGetStrokeMiter(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -428,7 +428,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetStrokeMiter(Paint thisPaint, long nativePaint, float miter) {
|
||||
/*package*/ static void nSetStrokeMiter(long nativePaint, float miter) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -455,14 +455,14 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static boolean nIsElegantTextHeight(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static boolean nIsElegantTextHeight(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
return delegate != null && delegate.mFontVariant == FontVariant.ELEGANT;
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetElegantTextHeight(Paint thisPaint, long nativePaint,
|
||||
/*package*/ static void nSetElegantTextHeight(long nativePaint,
|
||||
boolean elegant) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
@@ -474,7 +474,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nGetTextSize(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static float nGetTextSize(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -485,7 +485,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetTextSize(Paint thisPaint, long nativePaint, float textSize) {
|
||||
/*package*/ static void nSetTextSize(long nativePaint, float textSize) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -499,7 +499,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nGetTextScaleX(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static float nGetTextScaleX(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -510,7 +510,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetTextScaleX(Paint thisPaint, long nativePaint, float scaleX) {
|
||||
/*package*/ static void nSetTextScaleX(long nativePaint, float scaleX) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -524,7 +524,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nGetTextSkewX(Paint thisPaint, long nativePaint) {
|
||||
/*package*/ static float nGetTextSkewX(long nativePaint) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -535,7 +535,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static void nSetTextSkewX(Paint thisPaint, long nativePaint, float skewX) {
|
||||
/*package*/ static void nSetTextSkewX(long nativePaint, float skewX) {
|
||||
// get the delegate from the native int.
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -549,7 +549,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nAscent(Paint thisPaint, long nativePaint, long nativeTypeface) {
|
||||
/*package*/ static float nAscent(long nativePaint, long nativeTypeface) {
|
||||
// get the delegate
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -566,7 +566,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nDescent(Paint thisPaint, long nativePaint, long nativeTypeface) {
|
||||
/*package*/ static float nDescent(long nativePaint, long nativeTypeface) {
|
||||
// get the delegate
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
if (delegate == null) {
|
||||
@@ -583,7 +583,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static float nGetFontMetrics(Paint thisPaint, long nativePaint, long nativeTypeface,
|
||||
/*package*/ static float nGetFontMetrics(long nativePaint, long nativeTypeface,
|
||||
FontMetrics metrics) {
|
||||
// get the delegate
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
@@ -595,7 +595,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetFontMetricsInt(Paint thisPaint, long nativePaint,
|
||||
/*package*/ static int nGetFontMetricsInt(long nativePaint,
|
||||
long nativeTypeface, FontMetricsInt fmi) {
|
||||
// get the delegate
|
||||
Paint_Delegate delegate = sManager.getDelegate(nativePaint);
|
||||
@@ -998,7 +998,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetTextRunCursor(Paint thisPaint, long native_object, char[] text,
|
||||
/*package*/ static int nGetTextRunCursor(long native_object, char[] text,
|
||||
int contextStart, int contextLength, int flags, int offset, int cursorOpt) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
@@ -1007,7 +1007,7 @@ public class Paint_Delegate {
|
||||
}
|
||||
|
||||
@LayoutlibDelegate
|
||||
/*package*/ static int nGetTextRunCursor(Paint thisPaint, long native_object, String text,
|
||||
/*package*/ static int nGetTextRunCursor(long native_object, String text,
|
||||
int contextStart, int contextEnd, int flags, int offset, int cursorOpt) {
|
||||
// FIXME
|
||||
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
|
||||
|
||||
@@ -141,12 +141,12 @@ public class VectorDrawable_Delegate {
|
||||
long colorFilterPtr, Rect bounds, boolean needsMirroring, boolean canReuseCache) {
|
||||
VPathRenderer_Delegate nativePathRenderer = VNativeObject.getDelegate(rendererPtr);
|
||||
|
||||
Canvas_Delegate.native_save(canvasWrapperPtr, MATRIX_SAVE_FLAG | CLIP_SAVE_FLAG);
|
||||
Canvas_Delegate.native_translate(canvasWrapperPtr, bounds.left, bounds.top);
|
||||
Canvas_Delegate.nSave(canvasWrapperPtr, MATRIX_SAVE_FLAG | CLIP_SAVE_FLAG);
|
||||
Canvas_Delegate.nTranslate(canvasWrapperPtr, bounds.left, bounds.top);
|
||||
|
||||
if (needsMirroring) {
|
||||
Canvas_Delegate.native_translate(canvasWrapperPtr, bounds.width(), 0);
|
||||
Canvas_Delegate.native_scale(canvasWrapperPtr, -1.0f, 1.0f);
|
||||
Canvas_Delegate.nTranslate(canvasWrapperPtr, bounds.width(), 0);
|
||||
Canvas_Delegate.nScale(canvasWrapperPtr, -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
// At this point, canvas has been translated to the right position.
|
||||
@@ -155,7 +155,7 @@ public class VectorDrawable_Delegate {
|
||||
bounds.offsetTo(0, 0);
|
||||
nativePathRenderer.draw(canvasWrapperPtr, colorFilterPtr, bounds.width(), bounds.height());
|
||||
|
||||
Canvas_Delegate.native_restore(canvasWrapperPtr, true);
|
||||
Canvas_Delegate.nRestore(canvasWrapperPtr, true);
|
||||
|
||||
return bounds.width() * bounds.height();
|
||||
}
|
||||
@@ -1108,7 +1108,7 @@ public class VectorDrawable_Delegate {
|
||||
currentGroup.mStackedMatrix.preConcat(currentGroup.mLocalMatrix);
|
||||
|
||||
// Save the current clip information, which is local to this group.
|
||||
Canvas_Delegate.native_save(canvasPtr, MATRIX_SAVE_FLAG | CLIP_SAVE_FLAG);
|
||||
Canvas_Delegate.nSave(canvasPtr, MATRIX_SAVE_FLAG | CLIP_SAVE_FLAG);
|
||||
// Draw the group tree in the same order as the XML file.
|
||||
for (int i = 0; i < currentGroup.mChildren.size(); i++) {
|
||||
Object child = currentGroup.mChildren.get(i);
|
||||
@@ -1121,7 +1121,7 @@ public class VectorDrawable_Delegate {
|
||||
drawPath(currentGroup, childPath, canvasPtr, w, h, filterPtr);
|
||||
}
|
||||
}
|
||||
Canvas_Delegate.native_restore(canvasPtr, true);
|
||||
Canvas_Delegate.nRestore(canvasPtr, true);
|
||||
}
|
||||
|
||||
public void draw(long canvasPtr, long filterPtr, int w, int h) {
|
||||
@@ -1153,7 +1153,7 @@ public class VectorDrawable_Delegate {
|
||||
|
||||
if (VPath.isClipPath()) {
|
||||
mRenderPath.addPath(path, mFinalPathMatrix);
|
||||
Canvas_Delegate.native_clipPath(canvasPtr, mRenderPath.mNativePath, Op
|
||||
Canvas_Delegate.nClipPath(canvasPtr, mRenderPath.mNativePath, Op
|
||||
.INTERSECT.nativeInt);
|
||||
} else {
|
||||
VFullPath_Delegate fullPath = (VFullPath_Delegate) VPath;
|
||||
@@ -1197,7 +1197,7 @@ public class VectorDrawable_Delegate {
|
||||
fillPaintDelegate.setColorFilter(filterPtr);
|
||||
fillPaintDelegate.setShader(fullPath.mFillGradient);
|
||||
Path_Delegate.native_setFillType(mRenderPath.mNativePath, fullPath.mFillType);
|
||||
Canvas_Delegate.native_drawPath(canvasPtr, mRenderPath.mNativePath, fillPaint
|
||||
Canvas_Delegate.nDrawPath(canvasPtr, mRenderPath.mNativePath, fillPaint
|
||||
.getNativeInstance());
|
||||
}
|
||||
|
||||
@@ -1228,7 +1228,7 @@ public class VectorDrawable_Delegate {
|
||||
final float finalStrokeScale = minScale * matrixScale;
|
||||
strokePaint.setStrokeWidth(fullPath.mStrokeWidth * finalStrokeScale);
|
||||
strokePaintDelegate.setShader(fullPath.mStrokeGradient);
|
||||
Canvas_Delegate.native_drawPath(canvasPtr, mRenderPath.mNativePath, strokePaint
|
||||
Canvas_Delegate.nDrawPath(canvasPtr, mRenderPath.mNativePath, strokePaint
|
||||
.getNativeInstance());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user