Loading tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +21 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.layoutlib.bridge.impl.GcSnapshot; import android.graphics.Bitmap.Config; import android.graphics.Paint_Delegate.FontInfo; import android.text.TextUtils; Loading Loading @@ -98,8 +99,13 @@ public final class Canvas_Delegate { // ---- native methods ---- /*package*/ static boolean isOpaque(Canvas thisCanvas) { // FIXME throw new UnsupportedOperationException(); // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(thisCanvas.mNativeCanvas); if (canvasDelegate == null) { return false; } return canvasDelegate.mBitmap.getConfig() == Config.RGB_565; } /*package*/ static int getWidth(Canvas thisCanvas) { Loading Loading @@ -511,8 +517,19 @@ public final class Canvas_Delegate { } /*package*/ static void native_getCTM(int canvas, int matrix) { // FIXME throw new UnsupportedOperationException(); // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas); if (canvasDelegate == null) { return; } Matrix_Delegate matrixDelegate = Matrix_Delegate.getDelegate(matrix); if (matrixDelegate == null) { return; } AffineTransform transform = canvasDelegate.getSnapshot().getTransform(); matrixDelegate.set(Matrix_Delegate.makeValues(transform)); } /*package*/ static boolean native_quickReject(int nativeCanvas, Loading tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java +14 −2 Original line number Diff line number Diff line Loading @@ -83,6 +83,14 @@ public final class Matrix_Delegate { System.arraycopy(matrix.mValues, 0, mValues, 0, MATRIX_SIZE); } /** * Sets the content of the matrix with the content of another matrix represented as an array * of values. */ public void set(float[] values) { System.arraycopy(values, 0, mValues, 0, MATRIX_SIZE); } /** * Resets the matrix to be the identity matrix. */ Loading @@ -105,7 +113,7 @@ public final class Matrix_Delegate { return true; } public static Matrix_Delegate make(AffineTransform matrix) { public static float[] makeValues(AffineTransform matrix) { float[] values = new float[MATRIX_SIZE]; values[0] = (float) matrix.getScaleX(); values[1] = (float) matrix.getShearX(); Loading @@ -117,7 +125,11 @@ public final class Matrix_Delegate { values[7] = 0.f; values[8] = 1.f; return new Matrix_Delegate(values); return values; } public static Matrix_Delegate make(AffineTransform matrix) { return new Matrix_Delegate(makeValues(matrix)); } public boolean mapRect(RectF dst, RectF src) { Loading tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +1 −1 Original line number Diff line number Diff line Loading @@ -375,7 +375,7 @@ public class Paint_Delegate { /*package*/ static void nSetShadowLayer(Paint thisPaint, float radius, float dx, float dy, int color) { // FIXME throw new UnsupportedOperationException(); Bridge.getLog().fidelityWarning(null, "Paint.setShadowLayer is not supported.", null); } /*package*/ static float getTextSize(Paint thisPaint) { Loading tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java +12 −18 Original line number Diff line number Diff line Loading @@ -237,8 +237,7 @@ public final class Path_Delegate { pathDelegate.quadTo(x1, y1, x2, y2); } /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2) { /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; Loading Loading @@ -295,8 +294,8 @@ public final class Path_Delegate { pathDelegate.addRect(rect.left, rect.top, rect.right, rect.bottom, dir); } /*package*/ static void native_addRect(int nPath, float left, float top, float right, float bottom, int dir) { /*package*/ static void native_addRect(int nPath, float left, float top, float right, float bottom, int dir) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; Loading @@ -310,8 +309,7 @@ public final class Path_Delegate { throw new UnsupportedOperationException(); } /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) { /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) { // FIXME throw new UnsupportedOperationException(); } Loading @@ -328,21 +326,18 @@ public final class Path_Delegate { throw new UnsupportedOperationException(); } /*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) { /*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) { // FIXME throw new UnsupportedOperationException(); } /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) { /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) { // FIXME throw new UnsupportedOperationException(); } /*package*/ static void native_addPath(int nPath, int src) { // FIXME throw new UnsupportedOperationException(); native_addPath(nPath, src, 0, 0); } /*package*/ static void native_addPath(int nPath, int src, int matrix) { Loading @@ -350,8 +345,7 @@ public final class Path_Delegate { throw new UnsupportedOperationException(); } /*package*/ static void native_offset(int nPath, float dx, float dy, int dst_path) { /*package*/ static void native_offset(int nPath, float dx, float dy, int dst_path) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; Loading Loading
tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +21 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.layoutlib.bridge.impl.GcSnapshot; import android.graphics.Bitmap.Config; import android.graphics.Paint_Delegate.FontInfo; import android.text.TextUtils; Loading Loading @@ -98,8 +99,13 @@ public final class Canvas_Delegate { // ---- native methods ---- /*package*/ static boolean isOpaque(Canvas thisCanvas) { // FIXME throw new UnsupportedOperationException(); // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(thisCanvas.mNativeCanvas); if (canvasDelegate == null) { return false; } return canvasDelegate.mBitmap.getConfig() == Config.RGB_565; } /*package*/ static int getWidth(Canvas thisCanvas) { Loading Loading @@ -511,8 +517,19 @@ public final class Canvas_Delegate { } /*package*/ static void native_getCTM(int canvas, int matrix) { // FIXME throw new UnsupportedOperationException(); // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas); if (canvasDelegate == null) { return; } Matrix_Delegate matrixDelegate = Matrix_Delegate.getDelegate(matrix); if (matrixDelegate == null) { return; } AffineTransform transform = canvasDelegate.getSnapshot().getTransform(); matrixDelegate.set(Matrix_Delegate.makeValues(transform)); } /*package*/ static boolean native_quickReject(int nativeCanvas, Loading
tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java +14 −2 Original line number Diff line number Diff line Loading @@ -83,6 +83,14 @@ public final class Matrix_Delegate { System.arraycopy(matrix.mValues, 0, mValues, 0, MATRIX_SIZE); } /** * Sets the content of the matrix with the content of another matrix represented as an array * of values. */ public void set(float[] values) { System.arraycopy(values, 0, mValues, 0, MATRIX_SIZE); } /** * Resets the matrix to be the identity matrix. */ Loading @@ -105,7 +113,7 @@ public final class Matrix_Delegate { return true; } public static Matrix_Delegate make(AffineTransform matrix) { public static float[] makeValues(AffineTransform matrix) { float[] values = new float[MATRIX_SIZE]; values[0] = (float) matrix.getScaleX(); values[1] = (float) matrix.getShearX(); Loading @@ -117,7 +125,11 @@ public final class Matrix_Delegate { values[7] = 0.f; values[8] = 1.f; return new Matrix_Delegate(values); return values; } public static Matrix_Delegate make(AffineTransform matrix) { return new Matrix_Delegate(makeValues(matrix)); } public boolean mapRect(RectF dst, RectF src) { Loading
tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +1 −1 Original line number Diff line number Diff line Loading @@ -375,7 +375,7 @@ public class Paint_Delegate { /*package*/ static void nSetShadowLayer(Paint thisPaint, float radius, float dx, float dy, int color) { // FIXME throw new UnsupportedOperationException(); Bridge.getLog().fidelityWarning(null, "Paint.setShadowLayer is not supported.", null); } /*package*/ static float getTextSize(Paint thisPaint) { Loading
tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java +12 −18 Original line number Diff line number Diff line Loading @@ -237,8 +237,7 @@ public final class Path_Delegate { pathDelegate.quadTo(x1, y1, x2, y2); } /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2) { /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; Loading Loading @@ -295,8 +294,8 @@ public final class Path_Delegate { pathDelegate.addRect(rect.left, rect.top, rect.right, rect.bottom, dir); } /*package*/ static void native_addRect(int nPath, float left, float top, float right, float bottom, int dir) { /*package*/ static void native_addRect(int nPath, float left, float top, float right, float bottom, int dir) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; Loading @@ -310,8 +309,7 @@ public final class Path_Delegate { throw new UnsupportedOperationException(); } /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) { /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) { // FIXME throw new UnsupportedOperationException(); } Loading @@ -328,21 +326,18 @@ public final class Path_Delegate { throw new UnsupportedOperationException(); } /*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) { /*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) { // FIXME throw new UnsupportedOperationException(); } /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) { /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) { // FIXME throw new UnsupportedOperationException(); } /*package*/ static void native_addPath(int nPath, int src) { // FIXME throw new UnsupportedOperationException(); native_addPath(nPath, src, 0, 0); } /*package*/ static void native_addPath(int nPath, int src, int matrix) { Loading @@ -350,8 +345,7 @@ public final class Path_Delegate { throw new UnsupportedOperationException(); } /*package*/ static void native_offset(int nPath, float dx, float dy, int dst_path) { /*package*/ static void native_offset(int nPath, float dx, float dy, int dst_path) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; Loading