summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-04-24 14:13:40 -0700
committerChris Craik <ccraik@google.com>2014-04-24 14:23:52 -0700
commit4d1c1538e2422d0a5b19ad1cd2fb353ed6279a88 (patch)
tree9321774eb499ea3053bd46620e094fe5818edb8e /graphics
parent717f39c7d98c7e4b08f7bb88102c720cb8990004 (diff)
downloadframeworks_base-4d1c1538e2422d0a5b19ad1cd2fb353ed6279a88.zip
frameworks_base-4d1c1538e2422d0a5b19ad1cd2fb353ed6279a88.tar.gz
frameworks_base-4d1c1538e2422d0a5b19ad1cd2fb353ed6279a88.tar.bz2
Add floats-only drawRoundRect to Canvas
Change-Id: Ib0033a2d2486a808a44984ec4adf7fef76d9ea17
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/Canvas.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index f80ce28..ae3eae1 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1075,11 +1075,20 @@ public class Canvas {
* @param paint The paint used to draw the roundRect
*/
public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) {
- if (rect == null) {
- throw new NullPointerException();
- }
- native_drawRoundRect(mNativeCanvas, rect, rx, ry,
- paint.mNativePaint);
+ drawRoundRect(rect.left, rect.top, rect.right, rect.bottom, rx, ry, paint);
+ }
+
+ /**
+ * Draw the specified round-rect using the specified paint. The roundrect
+ * will be filled or framed based on the Style in the paint.
+ *
+ * @param rx The x-radius of the oval used to round the corners
+ * @param ry The y-radius of the oval used to round the corners
+ * @param paint The paint used to draw the roundRect
+ */
+ public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry,
+ Paint paint) {
+ native_drawRoundRect(mNativeCanvas, left, top, right, bottom, rx, ry, paint.mNativePaint);
}
/**
@@ -1816,8 +1825,8 @@ public class Canvas {
boolean useCenter,
long nativePaint);
private static native void native_drawRoundRect(long nativeCanvas,
- RectF rect, float rx,
- float ry, long nativePaint);
+ float left, float top, float right, float bottom,
+ float rx, float ry, long nativePaint);
private static native void native_drawPath(long nativeCanvas,
long nativePath,
long nativePaint);