summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/create/src
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-10-28 11:52:00 -0700
committerXavier Ducrohet <xav@android.com>2010-11-01 13:31:47 -0700
commit9f63ff263b0a97f0fa63e97136c18f6abccbfc68 (patch)
tree51941d0fad58ffb49097b1da5c7b7551da16a570 /tools/layoutlib/create/src
parent5c95212f6a8f5786b8199cdc4bb3725d15ada993 (diff)
downloadframeworks_base-9f63ff263b0a97f0fa63e97136c18f6abccbfc68.zip
frameworks_base-9f63ff263b0a97f0fa63e97136c18f6abccbfc68.tar.gz
frameworks_base-9f63ff263b0a97f0fa63e97136c18f6abccbfc68.tar.bz2
Layoutlib Canvas and Paint implementation through native delegates
Also fix native delegate generation to put "this" parameter even for methods that don't have any parameters. Change-Id: I5dd0c505871370ff7b4cda16de84a5b3ae438f73
Diffstat (limited to 'tools/layoutlib/create/src')
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java11
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java2
2 files changed, 3 insertions, 10 deletions
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
index 0ecb474..c845cc4 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
@@ -104,7 +104,9 @@ public final class CreateInfo implements ICreateInfo {
*/
private final static String[] DELEGATE_CLASS_NATIVES = new String[] {
"android.graphics.Bitmap",
+ "android.graphics.Canvas",
"android.graphics.Matrix",
+ "android.graphics.Paint",
"android.graphics.Typeface",
};
@@ -126,11 +128,9 @@ public final class CreateInfo implements ICreateInfo {
new String[] {
"android.graphics.BitmapFactory", "android.graphics._Original_BitmapFactory",
"android.graphics.BitmapShader", "android.graphics._Original_BitmapShader",
- "android.graphics.Canvas", "android.graphics._Original_Canvas",
"android.graphics.ComposeShader", "android.graphics._Original_ComposeShader",
"android.graphics.DashPathEffect", "android.graphics._Original_DashPathEffect",
"android.graphics.LinearGradient", "android.graphics._Original_LinearGradient",
- "android.graphics.Paint", "android.graphics._Original_Paint",
"android.graphics.Path", "android.graphics._Original_Path",
"android.graphics.PorterDuffXfermode", "android.graphics._Original_PorterDuffXfermode",
"android.graphics.RadialGradient", "android.graphics._Original_RadialGradient",
@@ -150,13 +150,6 @@ public final class CreateInfo implements ICreateInfo {
*/
private final static String[] DELETE_RETURNS =
new String[] {
- "android.graphics.Paint", // class to delete methods from
- "android.graphics.Paint$Align", // list of type identifying methods to delete
- "android.graphics.Paint$Style",
- "android.graphics.Paint$Join",
- "android.graphics.Paint$Cap",
- "android.graphics.Paint$FontMetrics",
- "android.graphics.Paint$FontMetricsInt",
null }; // separator, for next class/methods list.
}
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java
index 21d6682..c7968a4 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java
@@ -169,7 +169,7 @@ class DelegateMethodAdapter implements MethodVisitor {
// Construct the descriptor of the delegate. For a static method, it's the same
// however for an instance method we need to pass the 'this' reference first
String desc = mDesc;
- if (!mIsStatic && argTypes.length > 0) {
+ if (!mIsStatic) {
Type[] argTypes2 = new Type[argTypes.length + 1];
argTypes2[0] = Type.getObjectType(mClassName);