summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src/android/graphics
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-02-09 19:39:52 -0800
committerXavier Ducrohet <xav@android.com>2011-02-09 19:39:52 -0800
commit8a80a8555238cc564f445f902aff5231993a8f96 (patch)
tree27ef0db5a801c005c0c48b94bcea8b22715a1c29 /tools/layoutlib/bridge/src/android/graphics
parent9a4fe29c8d92014d2d9a848e9116b8cc9d0842f9 (diff)
downloadframeworks_base-8a80a8555238cc564f445f902aff5231993a8f96.zip
frameworks_base-8a80a8555238cc564f445f902aff5231993a8f96.tar.gz
frameworks_base-8a80a8555238cc564f445f902aff5231993a8f96.tar.bz2
LayoutLib: remove some exceptions.
We need to move away from throwing anything and instead log errors/warnings. Change-Id: Ib1af71a90c06e8565fbd0c061ba56f4d19baa3df
Diffstat (limited to 'tools/layoutlib/bridge/src/android/graphics')
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java6
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java59
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java36
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java21
4 files changed, 78 insertions, 44 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
index 9da8c1a..0c87766 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
@@ -383,13 +383,15 @@ public final class Bitmap_Delegate {
@LayoutlibDelegate
/*package*/ static void nativeCopyPixelsToBuffer(int nativeBitmap, Buffer dst) {
// FIXME implement native delegate
- throw new UnsupportedOperationException("Native delegate needed for Bitmap.nativeCopyPixelsToBuffer");
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Bitmap.copyPixelsToBuffer is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void nativeCopyPixelsFromBuffer(int nb, Buffer src) {
// FIXME implement native delegate
- throw new UnsupportedOperationException("Native delegate needed for Bitmap.nativeCopyPixelsFromBuffer");
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Bitmap.copyPixelsFromBuffer is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index bb98843..e8a99b5 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -273,13 +273,15 @@ public final class Canvas_Delegate {
/*package*/ static void drawPoints(Canvas thisCanvas, float[] pts, int offset, int count,
Paint paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawPoint is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void drawPoint(Canvas thisCanvas, float x, float y, Paint paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawPoint is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -645,7 +647,8 @@ public final class Canvas_Delegate {
@LayoutlibDelegate
/*package*/ static void native_drawPaint(int nativeCanvas, int paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawPaint is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -718,20 +721,19 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawCircle(int nativeCanvas, float cx,
- float cy, float radius,
- int paint) {
+ /*package*/ static void native_drawCircle(int nativeCanvas,
+ float cx, float cy, float radius, int paint) {
native_drawOval(nativeCanvas,
new RectF(cx - radius, cy - radius, radius*2, radius*2),
paint);
}
@LayoutlibDelegate
- /*package*/ static void native_drawArc(int nativeCanvas, RectF oval,
- float startAngle, float sweep,
- boolean useCenter, int paint) {
+ /*package*/ static void native_drawArc(int nativeCanvas,
+ RectF oval, float startAngle, float sweep, boolean useCenter, int paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawArc is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -764,8 +766,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawPath(int nativeCanvas, int path,
- int paint) {
+ /*package*/ static void native_drawPath(int nativeCanvas, int path, int paint) {
final Path_Delegate pathDelegate = Path_Delegate.getDelegate(path);
if (pathDelegate == null) {
return;
@@ -929,20 +930,23 @@ public final class Canvas_Delegate {
@LayoutlibDelegate
/*package*/ static void nativeDrawBitmapMesh(int nCanvas, int nBitmap,
- int meshWidth, int meshHeight,
- float[] verts, int vertOffset,
- int[] colors, int colorOffset, int nPaint) {
+ int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors,
+ int colorOffset, int nPaint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawBitmapMesh is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void nativeDrawVertices(int nCanvas, int mode, int n,
- float[] verts, int vertOffset, float[] texs, int texOffset,
- int[] colors, int colorOffset, short[] indices,
- int indexOffset, int indexCount, int nPaint) {
+ float[] verts, int vertOffset,
+ float[] texs, int texOffset,
+ int[] colors, int colorOffset,
+ short[] indices, int indexOffset,
+ int indexCount, int nPaint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawVertices is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -1080,7 +1084,8 @@ public final class Canvas_Delegate {
int count, float[] pos,
int paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawPosText is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -1088,7 +1093,8 @@ public final class Canvas_Delegate {
String text, float[] pos,
int paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawPosText is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -1099,7 +1105,8 @@ public final class Canvas_Delegate {
float vOffset, int bidiFlags,
int paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawTextOnPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -1109,14 +1116,16 @@ public final class Canvas_Delegate {
float vOffset,
int flags, int paint) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawTextOnPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_drawPicture(int nativeCanvas,
int nativePicture) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Canvas.drawPicture is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
index 39c8a37..f5d2547 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
@@ -568,14 +568,18 @@ public class Paint_Delegate {
/*package*/ static int native_breakText(Paint thisPaint, char[] text, int index, int count,
float maxWidth, float[] measuredWidth) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.native_breakText is not supported.", null, null /*data*/);
+ return 0;
}
@LayoutlibDelegate
/*package*/ static int native_breakText(Paint thisPaint, String text, boolean measureForwards,
float maxWidth, float[] measuredWidth) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.native_breakText is not supported.", null, null /*data*/);
+ return 0;
}
@LayoutlibDelegate
@@ -859,14 +863,18 @@ public class Paint_Delegate {
/*package*/ static int native_getTextWidths(int native_object, char[] text, int index,
int count, float[] widths) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getTextWidths is not supported.", null, null /*data*/);
+ return 0;
}
@LayoutlibDelegate
/*package*/ static int native_getTextWidths(int native_object, String text, int start,
int end, float[] widths) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getTextWidths is not supported.", null, null /*data*/);
+ return 0;
}
@LayoutlibDelegate
@@ -930,42 +938,50 @@ public class Paint_Delegate {
/*package*/ static int native_getTextRunCursor(Paint thisPaint, int native_object, char[] text,
int contextStart, int contextLength, int flags, int offset, int cursorOpt) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getTextRunCursor is not supported.", null, null /*data*/);
+ return 0;
}
@LayoutlibDelegate
/*package*/ static int native_getTextRunCursor(Paint thisPaint, int native_object, String text,
int contextStart, int contextEnd, int flags, int offset, int cursorOpt) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getTextRunCursor is not supported.", null, null /*data*/);
+ return 0;
}
@LayoutlibDelegate
/*package*/ static void native_getTextPath(int native_object, int bidiFlags,
char[] text, int index, int count, float x, float y, int path) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getTextPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_getTextPath(int native_object, int bidiFlags,
String text, int start, int end, float x, float y, int path) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getTextPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void nativeGetStringBounds(int nativePaint, String text, int start,
int end, Rect bounds) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getStringBounds is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void nativeGetCharArrayBounds(int nativePaint, char[] text, int index,
int count, Rect bounds) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Paint.getCharArrayBounds is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
diff --git a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
index 6c15a1a..9510ce0 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
@@ -332,39 +332,45 @@ public final class Path_Delegate {
@LayoutlibDelegate
/*package*/ static void native_addOval(int nPath, RectF oval, int dir) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addOval is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addCircle is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_addArc(int nPath, RectF oval,
float startAngle, float sweepAngle) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addArc is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_addRoundRect(int nPath, RectF rect,
float rx, float ry, int dir) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addRoundRect is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addRoundRect is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
/*package*/ static void native_addPath(int nPath, int src, float dx, float dy) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
@@ -375,7 +381,8 @@ public final class Path_Delegate {
@LayoutlibDelegate
/*package*/ static void native_addPath(int nPath, int src, int matrix) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
+ "Path.addPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate