summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2013-05-23 15:20:04 -0700
committerDeepanshu Gupta <deepanshu@google.com>2013-05-23 16:44:01 -0700
commit279c00e8e0abb20f7e10577c77937c058da080bf (patch)
treee7feb31b205abba693e7f3ba49a8f99088176bea /tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
parentd6619ed89ff7e10b0b66aadc353cfea171929344 (diff)
downloadframeworks_base-279c00e8e0abb20f7e10577c77937c058da080bf.zip
frameworks_base-279c00e8e0abb20f7e10577c77937c058da080bf.tar.gz
frameworks_base-279c00e8e0abb20f7e10577c77937c058da080bf.tar.bz2
Add missing native methods.
Change-Id: I7b34e2ec0164520efc658053a80f307791a992b1
Diffstat (limited to 'tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java')
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 9aed8c8..4171bb5 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -330,20 +330,19 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setBitmap(int nativeCanvas, int bitmap) {
+ /*package*/ static void copyNativeCanvasState(int srcCanvas, int dstCanvas) {
// get the delegate from the native int.
- Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
- if (canvasDelegate == null) {
+ Canvas_Delegate srcCanvasDelegate = sManager.getDelegate(srcCanvas);
+ if (srcCanvasDelegate == null) {
return;
}
// get the delegate from the native int.
- Bitmap_Delegate bitmapDelegate = Bitmap_Delegate.getDelegate(bitmap);
- if (bitmapDelegate == null) {
+ Canvas_Delegate dstCanvasDelegate = sManager.getDelegate(dstCanvas);
+ if (dstCanvasDelegate == null) {
return;
}
-
- canvasDelegate.setBitmap(bitmapDelegate);
+ // TODO: actually copy the canvas state.
}
@LayoutlibDelegate
@@ -572,16 +571,14 @@ public final class Canvas_Delegate {
@LayoutlibDelegate
/*package*/ static boolean native_quickReject(int nativeCanvas,
- RectF rect,
- int native_edgeType) {
+ RectF rect) {
// FIXME properly implement quickReject
return false;
}
@LayoutlibDelegate
/*package*/ static boolean native_quickReject(int nativeCanvas,
- int path,
- int native_edgeType) {
+ int path) {
// FIXME properly implement quickReject
return false;
}
@@ -589,8 +586,7 @@ public final class Canvas_Delegate {
@LayoutlibDelegate
/*package*/ static boolean native_quickReject(int nativeCanvas,
float left, float top,
- float right, float bottom,
- int native_edgeType) {
+ float right, float bottom) {
// FIXME properly implement quickReject
return false;
}
@@ -994,7 +990,8 @@ public final class Canvas_Delegate {
float x = startX;
float y = startY;
if (paintDelegate.getTextAlign() != Paint.Align.LEFT.nativeInt) {
- float m = paintDelegate.measureText(text, index, count);
+ // TODO: check the value of bidiFlags.
+ float m = paintDelegate.measureText(text, index, count, 0);
if (paintDelegate.getTextAlign() == Paint.Align.CENTER.nativeInt) {
x -= m / 2;
} else if (paintDelegate.getTextAlign() == Paint.Align.RIGHT.nativeInt) {