Loading tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +6 −0 Original line number Diff line number Diff line Loading @@ -305,6 +305,12 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } @Override public ComplexColor getComplexColor(int index) { // TODO: Support GradientColor return getColorStateList(index); } /** * Retrieve the ColorStateList for the attribute at <var>index</var>. * The value may be either a single solid color or a reference to Loading tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +51 −51 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_setBitmap(long canvas, Bitmap bitmap) { public static void native_setBitmap(long canvas, Bitmap bitmap) { Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas); Bitmap_Delegate bitmapDelegate = Bitmap_Delegate.getDelegate(bitmap); if (canvasDelegate == null || bitmapDelegate==null) { Loading @@ -153,7 +153,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_isOpaque(long nativeCanvas) { public static boolean native_isOpaque(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -164,10 +164,10 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_setHighContrastText(long nativeCanvas, boolean highContrastText){} public static void native_setHighContrastText(long nativeCanvas, boolean highContrastText){} @LayoutlibDelegate /*package*/ static int native_getWidth(long nativeCanvas) { public static int native_getWidth(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -178,7 +178,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_getHeight(long nativeCanvas) { public static int native_getHeight(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -189,7 +189,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_save(long nativeCanvas, int saveFlags) { public static int native_save(long nativeCanvas, int saveFlags) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -200,7 +200,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_saveLayer(long nativeCanvas, float l, public static int native_saveLayer(long nativeCanvas, float l, float t, float r, float b, long paint, int layerFlags) { // get the delegate from the native int. Loading @@ -219,7 +219,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_saveLayerAlpha(long nativeCanvas, float l, public static int native_saveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags) { // get the delegate from the native int. Loading @@ -232,7 +232,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restore(long nativeCanvas, boolean throwOnUnderflow) { public static void native_restore(long nativeCanvas, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -244,7 +244,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restoreToCount(long nativeCanvas, int saveCount, public static void native_restoreToCount(long nativeCanvas, int saveCount, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Loading @@ -257,7 +257,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_getSaveCount(long nativeCanvas) { public static int native_getSaveCount(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -268,7 +268,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_translate(long nativeCanvas, float dx, float dy) { public static void native_translate(long nativeCanvas, float dx, float dy) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -279,7 +279,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_scale(long nativeCanvas, float sx, float sy) { public static void native_scale(long nativeCanvas, float sx, float sy) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -290,7 +290,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_rotate(long nativeCanvas, float degrees) { public static void native_rotate(long nativeCanvas, float degrees) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -301,7 +301,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_skew(long nativeCanvas, float kx, float ky) { public static void native_skew(long nativeCanvas, float kx, float ky) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -325,7 +325,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_concat(long nCanvas, long nMatrix) { public static void native_concat(long nCanvas, long nMatrix) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas); if (canvasDelegate == null) { Loading Loading @@ -353,7 +353,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_setMatrix(long nCanvas, long nMatrix) { public static void native_setMatrix(long nCanvas, long nMatrix) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas); if (canvasDelegate == null) { Loading Loading @@ -383,7 +383,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_clipRect(long nCanvas, public static boolean native_clipRect(long nCanvas, float left, float top, float right, float bottom, int regionOp) { Loading @@ -397,7 +397,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_clipPath(long nativeCanvas, public static boolean native_clipPath(long nativeCanvas, long nativePath, int regionOp) { Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -414,7 +414,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_clipRegion(long nativeCanvas, public static boolean native_clipRegion(long nativeCanvas, long nativeRegion, int regionOp) { Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -431,7 +431,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeSetDrawFilter(long nativeCanvas, long nativeFilter) { public static void nativeSetDrawFilter(long nativeCanvas, long nativeFilter) { Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { return; Loading @@ -446,7 +446,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_getClipBounds(long nativeCanvas, public static boolean native_getClipBounds(long nativeCanvas, Rect bounds) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -467,7 +467,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_getCTM(long canvas, long matrix) { public static void native_getCTM(long canvas, long matrix) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas); if (canvasDelegate == null) { Loading @@ -484,13 +484,13 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_quickReject(long nativeCanvas, long path) { public static boolean native_quickReject(long nativeCanvas, long path) { // FIXME properly implement quickReject return false; } @LayoutlibDelegate /*package*/ static boolean native_quickReject(long nativeCanvas, public static boolean native_quickReject(long nativeCanvas, float left, float top, float right, float bottom) { // FIXME properly implement quickReject Loading @@ -498,7 +498,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawColor(long nativeCanvas, final int color, final int mode) { public static void native_drawColor(long nativeCanvas, final int color, final int mode) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading Loading @@ -529,14 +529,14 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawPaint(long nativeCanvas, long paint) { public static void native_drawPaint(long nativeCanvas, long paint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, "Canvas.drawPaint is not supported.", null, null /*data*/); } @LayoutlibDelegate /*package*/ static void native_drawPoint(long nativeCanvas, float x, float y, public static void native_drawPoint(long nativeCanvas, float x, float y, long nativePaint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Loading @@ -544,7 +544,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawPoints(long nativeCanvas, float[] pts, int offset, int count, public static void native_drawPoints(long nativeCanvas, float[] pts, int offset, int count, long nativePaint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Loading @@ -552,7 +552,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawLine(long nativeCanvas, public static void native_drawLine(long nativeCanvas, final float startX, final float startY, final float stopX, final float stopY, long paint) { draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/, Loading @@ -565,7 +565,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawLines(long nativeCanvas, public static void native_drawLines(long nativeCanvas, final float[] pts, final int offset, final int count, long nativePaint) { draw(nativeCanvas, nativePaint, false /*compositeOnly*/, Loading @@ -581,7 +581,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawRect(long nativeCanvas, public static void native_drawRect(long nativeCanvas, final float left, final float top, final float right, final float bottom, long paint) { draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/, Loading @@ -607,7 +607,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawOval(long nativeCanvas, final float left, public static void native_drawOval(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*/, Loading @@ -634,7 +634,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawCircle(long nativeCanvas, public static void native_drawCircle(long nativeCanvas, float cx, float cy, float radius, long paint) { native_drawOval(nativeCanvas, cx - radius, cy - radius, cx + radius, cy + radius, Loading @@ -642,7 +642,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawArc(long nativeCanvas, public static void native_drawArc(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) { Loading Loading @@ -674,7 +674,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawRoundRect(long nativeCanvas, public static void native_drawRoundRect(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*/, Loading Loading @@ -704,7 +704,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawPath(long nativeCanvas, long path, long paint) { public static void native_drawPath(long nativeCanvas, long path, long paint) { final Path_Delegate pathDelegate = Path_Delegate.getDelegate(path); if (pathDelegate == null) { return; Loading Loading @@ -756,7 +756,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawRegion(long nativeCanvas, long nativeRegion, public static void native_drawRegion(long nativeCanvas, long nativeRegion, long nativePaint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Loading @@ -764,7 +764,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawNinePatch(Canvas thisCanvas, long nativeCanvas, public static void native_drawNinePatch(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) { Loading Loading @@ -811,7 +811,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap, public static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap, float left, float top, long nativePaintOrZero, int canvasDensity, Loading @@ -833,7 +833,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap, public static void native_drawBitmap(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) { Loading @@ -849,7 +849,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawBitmap(long nativeCanvas, int[] colors, public static void native_drawBitmap(long nativeCanvas, int[] colors, int offset, int stride, final float x, final float y, int width, int height, boolean hasAlpha, Loading @@ -874,7 +874,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeDrawBitmapMatrix(long nCanvas, Bitmap bitmap, public static void nativeDrawBitmapMatrix(long nCanvas, Bitmap bitmap, long nMatrix, long nPaint) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas); Loading Loading @@ -915,7 +915,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeDrawBitmapMesh(long nCanvas, Bitmap bitmap, public static void nativeDrawBitmapMesh(long nCanvas, Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nPaint) { // FIXME Loading @@ -924,7 +924,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeDrawVertices(long nCanvas, int mode, int n, public static void nativeDrawVertices(long nCanvas, int mode, int n, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, Loading @@ -936,14 +936,14 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawText(long nativeCanvas, char[] text, int index, int count, public static void native_drawText(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 /*package*/ static void native_drawText(long nativeCanvas, String text, public static void native_drawText(long nativeCanvas, String text, int start, int end, float x, float y, final int flags, long paint, long typeface) { int count = end - start; Loading @@ -954,7 +954,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawTextRun(long nativeCanvas, String text, public static void native_drawTextRun(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; Loading @@ -965,14 +965,14 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawTextRun(long nativeCanvas, char[] text, public static void native_drawTextRun(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 /*package*/ static void native_drawTextOnPath(long nativeCanvas, public static void native_drawTextOnPath(long nativeCanvas, char[] text, int index, int count, long path, float hOffset, Loading @@ -984,7 +984,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawTextOnPath(long nativeCanvas, public static void native_drawTextOnPath(long nativeCanvas, String text, long path, float hOffset, float vOffset, Loading tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +4 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,10 @@ public class Paint_Delegate { return mColorFilter; } public void setColorFilter(long colorFilterPtr) { mColorFilter = ColorFilter_Delegate.getDelegate(colorFilterPtr); } /** * Returns the {@link Shader} delegate or null if none have been set * Loading tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java +13 −13 Original line number Diff line number Diff line Loading @@ -572,7 +572,7 @@ public final class Path_Delegate { return null; } private static void addPath(long destPath, long srcPath, AffineTransform transform) { public static void addPath(long destPath, long srcPath, AffineTransform transform) { Path_Delegate destPathDelegate = sManager.getDelegate(destPath); if (destPathDelegate == null) { return; Loading Loading @@ -630,7 +630,7 @@ public final class Path_Delegate { * Fills the given {@link RectF} with the path bounds. * @param bounds the RectF to be filled. */ private void fillBounds(RectF bounds) { public void fillBounds(RectF bounds) { Rectangle2D rect = mPath.getBounds2D(); bounds.left = (float)rect.getMinX(); bounds.right = (float)rect.getMaxX(); Loading @@ -644,7 +644,7 @@ public final class Path_Delegate { * @param x The x-coordinate of the start of a new contour * @param y The y-coordinate of the start of a new contour */ private void moveTo(float x, float y) { public void moveTo(float x, float y) { mPath.moveTo(mLastX = x, mLastY = y); } Loading @@ -658,7 +658,7 @@ public final class Path_Delegate { * @param dy The amount to add to the y-coordinate of the end of the * previous contour, to specify the start of a new contour */ private void rMoveTo(float dx, float dy) { public void rMoveTo(float dx, float dy) { dx += mLastX; dy += mLastY; mPath.moveTo(mLastX = dx, mLastY = dy); Loading @@ -672,7 +672,7 @@ public final class Path_Delegate { * @param x The x-coordinate of the end of a line * @param y The y-coordinate of the end of a line */ private void lineTo(float x, float y) { public void lineTo(float x, float y) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } Loading @@ -689,7 +689,7 @@ public final class Path_Delegate { * @param dy The amount to add to the y-coordinate of the previous point on * this contour, to specify a line */ private void rLineTo(float dx, float dy) { public void rLineTo(float dx, float dy) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } Loading @@ -714,7 +714,7 @@ public final class Path_Delegate { * @param x2 The x-coordinate of the end point on a quadratic curve * @param y2 The y-coordinate of the end point on a quadratic curve */ private void quadTo(float x1, float y1, float x2, float y2) { public void quadTo(float x1, float y1, float x2, float y2) { mPath.quadTo(x1, y1, mLastX = x2, mLastY = y2); } Loading @@ -732,7 +732,7 @@ public final class Path_Delegate { * @param dy2 The amount to add to the y-coordinate of the last point on * this contour, for the end point of a quadratic curve */ private void rQuadTo(float dx1, float dy1, float dx2, float dy2) { public void rQuadTo(float dx1, float dy1, float dx2, float dy2) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } Loading @@ -755,7 +755,7 @@ public final class Path_Delegate { * @param x3 The x-coordinate of the end point on a cubic curve * @param y3 The y-coordinate of the end point on a cubic curve */ private void cubicTo(float x1, float y1, float x2, float y2, public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) { if (!hasPoints()) { mPath.moveTo(0, 0); Loading @@ -768,7 +768,7 @@ public final class Path_Delegate { * current point on this contour. If there is no previous point, then a * moveTo(0,0) is inserted automatically. */ private void rCubicTo(float dx1, float dy1, float dx2, float dy2, public void rCubicTo(float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); Loading Loading @@ -798,7 +798,7 @@ public final class Path_Delegate { * mod 360. * @param forceMoveTo If true, always begin a new contour with the arc */ private void arcTo(float left, float top, float right, float bottom, float startAngle, public void arcTo(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean forceMoveTo) { Arc2D arc = new Arc2D.Float(left, top, right - left, bottom - top, -startAngle, Loading @@ -812,7 +812,7 @@ public final class Path_Delegate { * Close the current contour. If the current point is not equal to the * first point of the contour, a line segment is automatically added. */ private void close() { public void close() { mPath.closePath(); } Loading @@ -831,7 +831,7 @@ public final class Path_Delegate { * @param bottom The bottom of a rectangle to add to the path * @param dir The direction to wind the rectangle's contour */ private void addRect(float left, float top, float right, float bottom, public void addRect(float left, float top, float right, float bottom, int dir) { moveTo(left, top); Loading Loading
tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +6 −0 Original line number Diff line number Diff line Loading @@ -305,6 +305,12 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } @Override public ComplexColor getComplexColor(int index) { // TODO: Support GradientColor return getColorStateList(index); } /** * Retrieve the ColorStateList for the attribute at <var>index</var>. * The value may be either a single solid color or a reference to Loading
tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +51 −51 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_setBitmap(long canvas, Bitmap bitmap) { public static void native_setBitmap(long canvas, Bitmap bitmap) { Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas); Bitmap_Delegate bitmapDelegate = Bitmap_Delegate.getDelegate(bitmap); if (canvasDelegate == null || bitmapDelegate==null) { Loading @@ -153,7 +153,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_isOpaque(long nativeCanvas) { public static boolean native_isOpaque(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -164,10 +164,10 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_setHighContrastText(long nativeCanvas, boolean highContrastText){} public static void native_setHighContrastText(long nativeCanvas, boolean highContrastText){} @LayoutlibDelegate /*package*/ static int native_getWidth(long nativeCanvas) { public static int native_getWidth(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -178,7 +178,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_getHeight(long nativeCanvas) { public static int native_getHeight(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -189,7 +189,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_save(long nativeCanvas, int saveFlags) { public static int native_save(long nativeCanvas, int saveFlags) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -200,7 +200,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_saveLayer(long nativeCanvas, float l, public static int native_saveLayer(long nativeCanvas, float l, float t, float r, float b, long paint, int layerFlags) { // get the delegate from the native int. Loading @@ -219,7 +219,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_saveLayerAlpha(long nativeCanvas, float l, public static int native_saveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags) { // get the delegate from the native int. Loading @@ -232,7 +232,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restore(long nativeCanvas, boolean throwOnUnderflow) { public static void native_restore(long nativeCanvas, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -244,7 +244,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restoreToCount(long nativeCanvas, int saveCount, public static void native_restoreToCount(long nativeCanvas, int saveCount, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Loading @@ -257,7 +257,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static int native_getSaveCount(long nativeCanvas) { public static int native_getSaveCount(long nativeCanvas) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -268,7 +268,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_translate(long nativeCanvas, float dx, float dy) { public static void native_translate(long nativeCanvas, float dx, float dy) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -279,7 +279,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_scale(long nativeCanvas, float sx, float sy) { public static void native_scale(long nativeCanvas, float sx, float sy) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -290,7 +290,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_rotate(long nativeCanvas, float degrees) { public static void native_rotate(long nativeCanvas, float degrees) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -301,7 +301,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_skew(long nativeCanvas, float kx, float ky) { public static void native_skew(long nativeCanvas, float kx, float ky) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -325,7 +325,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_concat(long nCanvas, long nMatrix) { public static void native_concat(long nCanvas, long nMatrix) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas); if (canvasDelegate == null) { Loading Loading @@ -353,7 +353,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_setMatrix(long nCanvas, long nMatrix) { public static void native_setMatrix(long nCanvas, long nMatrix) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas); if (canvasDelegate == null) { Loading Loading @@ -383,7 +383,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_clipRect(long nCanvas, public static boolean native_clipRect(long nCanvas, float left, float top, float right, float bottom, int regionOp) { Loading @@ -397,7 +397,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_clipPath(long nativeCanvas, public static boolean native_clipPath(long nativeCanvas, long nativePath, int regionOp) { Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -414,7 +414,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_clipRegion(long nativeCanvas, public static boolean native_clipRegion(long nativeCanvas, long nativeRegion, int regionOp) { Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -431,7 +431,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeSetDrawFilter(long nativeCanvas, long nativeFilter) { public static void nativeSetDrawFilter(long nativeCanvas, long nativeFilter) { Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { return; Loading @@ -446,7 +446,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_getClipBounds(long nativeCanvas, public static boolean native_getClipBounds(long nativeCanvas, Rect bounds) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Loading @@ -467,7 +467,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_getCTM(long canvas, long matrix) { public static void native_getCTM(long canvas, long matrix) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas); if (canvasDelegate == null) { Loading @@ -484,13 +484,13 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static boolean native_quickReject(long nativeCanvas, long path) { public static boolean native_quickReject(long nativeCanvas, long path) { // FIXME properly implement quickReject return false; } @LayoutlibDelegate /*package*/ static boolean native_quickReject(long nativeCanvas, public static boolean native_quickReject(long nativeCanvas, float left, float top, float right, float bottom) { // FIXME properly implement quickReject Loading @@ -498,7 +498,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawColor(long nativeCanvas, final int color, final int mode) { public static void native_drawColor(long nativeCanvas, final int color, final int mode) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading Loading @@ -529,14 +529,14 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawPaint(long nativeCanvas, long paint) { public static void native_drawPaint(long nativeCanvas, long paint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, "Canvas.drawPaint is not supported.", null, null /*data*/); } @LayoutlibDelegate /*package*/ static void native_drawPoint(long nativeCanvas, float x, float y, public static void native_drawPoint(long nativeCanvas, float x, float y, long nativePaint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Loading @@ -544,7 +544,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawPoints(long nativeCanvas, float[] pts, int offset, int count, public static void native_drawPoints(long nativeCanvas, float[] pts, int offset, int count, long nativePaint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Loading @@ -552,7 +552,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawLine(long nativeCanvas, public static void native_drawLine(long nativeCanvas, final float startX, final float startY, final float stopX, final float stopY, long paint) { draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/, Loading @@ -565,7 +565,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawLines(long nativeCanvas, public static void native_drawLines(long nativeCanvas, final float[] pts, final int offset, final int count, long nativePaint) { draw(nativeCanvas, nativePaint, false /*compositeOnly*/, Loading @@ -581,7 +581,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawRect(long nativeCanvas, public static void native_drawRect(long nativeCanvas, final float left, final float top, final float right, final float bottom, long paint) { draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/, Loading @@ -607,7 +607,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawOval(long nativeCanvas, final float left, public static void native_drawOval(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*/, Loading @@ -634,7 +634,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawCircle(long nativeCanvas, public static void native_drawCircle(long nativeCanvas, float cx, float cy, float radius, long paint) { native_drawOval(nativeCanvas, cx - radius, cy - radius, cx + radius, cy + radius, Loading @@ -642,7 +642,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawArc(long nativeCanvas, public static void native_drawArc(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) { Loading Loading @@ -674,7 +674,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawRoundRect(long nativeCanvas, public static void native_drawRoundRect(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*/, Loading Loading @@ -704,7 +704,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawPath(long nativeCanvas, long path, long paint) { public static void native_drawPath(long nativeCanvas, long path, long paint) { final Path_Delegate pathDelegate = Path_Delegate.getDelegate(path); if (pathDelegate == null) { return; Loading Loading @@ -756,7 +756,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawRegion(long nativeCanvas, long nativeRegion, public static void native_drawRegion(long nativeCanvas, long nativeRegion, long nativePaint) { // FIXME Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Loading @@ -764,7 +764,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawNinePatch(Canvas thisCanvas, long nativeCanvas, public static void native_drawNinePatch(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) { Loading Loading @@ -811,7 +811,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap, public static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap, float left, float top, long nativePaintOrZero, int canvasDensity, Loading @@ -833,7 +833,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, Bitmap bitmap, public static void native_drawBitmap(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) { Loading @@ -849,7 +849,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawBitmap(long nativeCanvas, int[] colors, public static void native_drawBitmap(long nativeCanvas, int[] colors, int offset, int stride, final float x, final float y, int width, int height, boolean hasAlpha, Loading @@ -874,7 +874,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeDrawBitmapMatrix(long nCanvas, Bitmap bitmap, public static void nativeDrawBitmapMatrix(long nCanvas, Bitmap bitmap, long nMatrix, long nPaint) { // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas); Loading Loading @@ -915,7 +915,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeDrawBitmapMesh(long nCanvas, Bitmap bitmap, public static void nativeDrawBitmapMesh(long nCanvas, Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nPaint) { // FIXME Loading @@ -924,7 +924,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void nativeDrawVertices(long nCanvas, int mode, int n, public static void nativeDrawVertices(long nCanvas, int mode, int n, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, Loading @@ -936,14 +936,14 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawText(long nativeCanvas, char[] text, int index, int count, public static void native_drawText(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 /*package*/ static void native_drawText(long nativeCanvas, String text, public static void native_drawText(long nativeCanvas, String text, int start, int end, float x, float y, final int flags, long paint, long typeface) { int count = end - start; Loading @@ -954,7 +954,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawTextRun(long nativeCanvas, String text, public static void native_drawTextRun(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; Loading @@ -965,14 +965,14 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawTextRun(long nativeCanvas, char[] text, public static void native_drawTextRun(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 /*package*/ static void native_drawTextOnPath(long nativeCanvas, public static void native_drawTextOnPath(long nativeCanvas, char[] text, int index, int count, long path, float hOffset, Loading @@ -984,7 +984,7 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_drawTextOnPath(long nativeCanvas, public static void native_drawTextOnPath(long nativeCanvas, String text, long path, float hOffset, float vOffset, Loading
tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +4 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,10 @@ public class Paint_Delegate { return mColorFilter; } public void setColorFilter(long colorFilterPtr) { mColorFilter = ColorFilter_Delegate.getDelegate(colorFilterPtr); } /** * Returns the {@link Shader} delegate or null if none have been set * Loading
tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java +13 −13 Original line number Diff line number Diff line Loading @@ -572,7 +572,7 @@ public final class Path_Delegate { return null; } private static void addPath(long destPath, long srcPath, AffineTransform transform) { public static void addPath(long destPath, long srcPath, AffineTransform transform) { Path_Delegate destPathDelegate = sManager.getDelegate(destPath); if (destPathDelegate == null) { return; Loading Loading @@ -630,7 +630,7 @@ public final class Path_Delegate { * Fills the given {@link RectF} with the path bounds. * @param bounds the RectF to be filled. */ private void fillBounds(RectF bounds) { public void fillBounds(RectF bounds) { Rectangle2D rect = mPath.getBounds2D(); bounds.left = (float)rect.getMinX(); bounds.right = (float)rect.getMaxX(); Loading @@ -644,7 +644,7 @@ public final class Path_Delegate { * @param x The x-coordinate of the start of a new contour * @param y The y-coordinate of the start of a new contour */ private void moveTo(float x, float y) { public void moveTo(float x, float y) { mPath.moveTo(mLastX = x, mLastY = y); } Loading @@ -658,7 +658,7 @@ public final class Path_Delegate { * @param dy The amount to add to the y-coordinate of the end of the * previous contour, to specify the start of a new contour */ private void rMoveTo(float dx, float dy) { public void rMoveTo(float dx, float dy) { dx += mLastX; dy += mLastY; mPath.moveTo(mLastX = dx, mLastY = dy); Loading @@ -672,7 +672,7 @@ public final class Path_Delegate { * @param x The x-coordinate of the end of a line * @param y The y-coordinate of the end of a line */ private void lineTo(float x, float y) { public void lineTo(float x, float y) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } Loading @@ -689,7 +689,7 @@ public final class Path_Delegate { * @param dy The amount to add to the y-coordinate of the previous point on * this contour, to specify a line */ private void rLineTo(float dx, float dy) { public void rLineTo(float dx, float dy) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } Loading @@ -714,7 +714,7 @@ public final class Path_Delegate { * @param x2 The x-coordinate of the end point on a quadratic curve * @param y2 The y-coordinate of the end point on a quadratic curve */ private void quadTo(float x1, float y1, float x2, float y2) { public void quadTo(float x1, float y1, float x2, float y2) { mPath.quadTo(x1, y1, mLastX = x2, mLastY = y2); } Loading @@ -732,7 +732,7 @@ public final class Path_Delegate { * @param dy2 The amount to add to the y-coordinate of the last point on * this contour, for the end point of a quadratic curve */ private void rQuadTo(float dx1, float dy1, float dx2, float dy2) { public void rQuadTo(float dx1, float dy1, float dx2, float dy2) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } Loading @@ -755,7 +755,7 @@ public final class Path_Delegate { * @param x3 The x-coordinate of the end point on a cubic curve * @param y3 The y-coordinate of the end point on a cubic curve */ private void cubicTo(float x1, float y1, float x2, float y2, public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) { if (!hasPoints()) { mPath.moveTo(0, 0); Loading @@ -768,7 +768,7 @@ public final class Path_Delegate { * current point on this contour. If there is no previous point, then a * moveTo(0,0) is inserted automatically. */ private void rCubicTo(float dx1, float dy1, float dx2, float dy2, public void rCubicTo(float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); Loading Loading @@ -798,7 +798,7 @@ public final class Path_Delegate { * mod 360. * @param forceMoveTo If true, always begin a new contour with the arc */ private void arcTo(float left, float top, float right, float bottom, float startAngle, public void arcTo(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean forceMoveTo) { Arc2D arc = new Arc2D.Float(left, top, right - left, bottom - top, -startAngle, Loading @@ -812,7 +812,7 @@ public final class Path_Delegate { * Close the current contour. If the current point is not equal to the * first point of the contour, a line segment is automatically added. */ private void close() { public void close() { mPath.closePath(); } Loading @@ -831,7 +831,7 @@ public final class Path_Delegate { * @param bottom The bottom of a rectangle to add to the path * @param dir The direction to wind the rectangle's contour */ private void addRect(float left, float top, float right, float bottom, public void addRect(float left, float top, float right, float bottom, int dir) { moveTo(left, top); Loading