method public void drawRect(android.graphics.Rect, android.graphics.Paint);
method public void drawRect(float, float, float, float, android.graphics.Paint);
method public void drawRoundRect(android.graphics.RectF, float, float, android.graphics.Paint);
+ method public void drawRoundRect(float, float, float, float, float, float, android.graphics.Paint);
method public void drawText(char[], int, int, float, float, android.graphics.Paint);
method public void drawText(java.lang.String, float, float, android.graphics.Paint);
method public void drawText(java.lang.String, int, int, float, float, android.graphics.Paint);
}
@Override
- public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) {
+ public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry,
+ Paint paint) {
int modifiers = setupModifiers(paint, MODIFIER_SHADER);
try {
- nDrawRoundRect(mRenderer, rect.left, rect.top, rect.right, rect.bottom,
- rx, ry, paint.mNativePaint);
+ nDrawRoundRect(mRenderer, left, top, right, bottom, rx, ry, paint.mNativePaint);
} finally {
if (modifiers != MODIFIER_NONE) nResetModifiers(mRenderer, modifiers);
}
}
static void drawRoundRect(JNIEnv* env, jobject, jlong canvasHandle,
- jobject jrect, jfloat rx, jfloat ry,
- jlong paintHandle) {
+ jfloat left, jfloat top, jfloat right, jfloat bottom, jfloat rx, jfloat ry,
+ jlong paintHandle) {
SkCanvas* canvas = reinterpret_cast<SkCanvas*>(canvasHandle);
SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
- SkRect rect;
- GraphicsJNI::jrectf_to_rect(env, jrect, &rect);
+ SkRect rect = SkRect::MakeLTRB(left, top, right, bottom);
canvas->drawRoundRect(rect, rx, ry, *paint);
}
{"native_drawCircle","(JFFFJ)V", (void*) SkCanvasGlue::drawCircle},
{"native_drawArc","(JLandroid/graphics/RectF;FFZJ)V",
(void*) SkCanvasGlue::drawArc},
- {"native_drawRoundRect","(JLandroid/graphics/RectF;FFJ)V",
+ {"native_drawRoundRect","(JFFFFFFJ)V",
(void*) SkCanvasGlue::drawRoundRect},
{"native_drawPath","(JJJ)V", (void*) SkCanvasGlue::drawPath},
{"native_drawBitmap","(JJFFJIII)V",
* @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);
}
/**
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);