Fix changed native method delegates in layoutlib for ICS.
Change-Id: I49306868cd8a41b6b7d919c3e8b108d5c014530e
diff --git a/bridge/src/android/graphics/Canvas_Delegate.java b/bridge/src/android/graphics/Canvas_Delegate.java
index 8e3ed93..b4448a9 100644
--- a/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/bridge/src/android/graphics/Canvas_Delegate.java
@@ -1093,6 +1093,33 @@
}
@LayoutlibDelegate
+ /*package*/ static void native_drawTextWithGlyphs(int nativeCanvas, char[] text,
+ int index, int count, float x,
+ float y, int flags, int paint) {
+ native_drawText(nativeCanvas, text, index, count, x, y, flags, paint);
+ }
+
+ @LayoutlibDelegate
+ /*package*/ static void native_drawTextWithGlyphs(int nativeCanvas, String text,
+ int start, int end, float x,
+ float y, int flags, int paint) {
+ int count = end - start;
+ char[] buffer = TemporaryBuffer.obtain(count);
+ TextUtils.getChars(text, start, end, buffer, 0);
+
+ native_drawText(nativeCanvas, text, 0, count, x, y, flags, paint);
+ }
+
+ @LayoutlibDelegate
+ /*package*/ static void native_drawGlyphs(int nativeCanvas, char[] glyphs,
+ int index, int count, float x,
+ float y, int flags, int paint) {
+ // FIXME
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawGlyphs is not supported.", null, null /*data*/);
+ }
+
+ @LayoutlibDelegate
/*package*/ static void native_drawPosText(int nativeCanvas,
char[] text, int index,
int count, float[] pos,
diff --git a/bridge/src/android/graphics/Paint_Delegate.java b/bridge/src/android/graphics/Paint_Delegate.java
index 373f482..7777e19 100644
--- a/bridge/src/android/graphics/Paint_Delegate.java
+++ b/bridge/src/android/graphics/Paint_Delegate.java
@@ -940,9 +940,16 @@
}
@LayoutlibDelegate
+ /* package */static int native_getTextGlyphs(int native_object, String text, int start,
+ int end, int contextStart, int contextEnd, int flags, char[] glyphs) {
+ // FIXME
+ return 0;
+ }
+
+ @LayoutlibDelegate
/*package*/ static float native_getTextRunAdvances(int native_object,
char[] text, int index, int count, int contextIndex, int contextCount,
- int flags, float[] advances, int advancesIndex) {
+ int flags, float[] advances, int advancesIndex, int reserved) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -986,14 +993,14 @@
@LayoutlibDelegate
/*package*/ static float native_getTextRunAdvances(int native_object,
String text, int start, int end, int contextStart, int contextEnd,
- int flags, float[] advances, int advancesIndex) {
+ int flags, float[] advances, int advancesIndex, int reserved) {
// FIXME: support contextStart, contextEnd and direction flag
int count = end - start;
char[] buffer = TemporaryBuffer.obtain(count);
TextUtils.getChars(text, start, end, buffer, 0);
return native_getTextRunAdvances(native_object, buffer, 0, count, contextStart,
- contextEnd - contextStart, flags, advances, advancesIndex);
+ contextEnd - contextStart, flags, advances, advancesIndex, reserved);
}
@LayoutlibDelegate