diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2014-06-25 16:57:03 -0700 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2014-07-01 12:22:13 -0700 |
commit | bb5d0cc4369590ce892cca2f717f5d5568c5f655 (patch) | |
tree | 6d0bcd3f091b6c790765f3cd207c20fdb76f4afd /tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java | |
parent | 3c989eaa0af6e3c4427af4119cf4949b1f05dba2 (diff) | |
download | frameworks_base-bb5d0cc4369590ce892cca2f717f5d5568c5f655.zip frameworks_base-bb5d0cc4369590ce892cca2f717f5d5568c5f655.tar.gz frameworks_base-bb5d0cc4369590ce892cca2f717f5d5568c5f655.tar.bz2 |
Update LayoutLib delegates.
Change-Id: I64828bfb963048effbc49a622f5f2aa0203665e6
Diffstat (limited to 'tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java')
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java index 0ec7115..7153a90 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java @@ -297,14 +297,15 @@ public final class Path_Delegate { } @LayoutlibDelegate - /*package*/ static void native_arcTo(long nPath, RectF oval, + /*package*/ static void native_arcTo(long nPath, float left, float top, float right, + float bottom, float startAngle, float sweepAngle, boolean forceMoveTo) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; } - pathDelegate.arcTo(oval, startAngle, sweepAngle, forceMoveTo); + pathDelegate.arcTo(left, top, right, bottom, startAngle, sweepAngle, forceMoveTo); } @LayoutlibDelegate @@ -353,8 +354,8 @@ public final class Path_Delegate { } @LayoutlibDelegate - /*package*/ static void native_addArc(long nPath, RectF oval, - float startAngle, float sweepAngle) { + /*package*/ static void native_addArc(long nPath, float left, float top, float right, + float bottom, float startAngle, float sweepAngle) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { return; @@ -362,13 +363,13 @@ public final class Path_Delegate { // because x/y is the center of the circle, need to offset this by the radius pathDelegate.mPath.append(new Arc2D.Float( - oval.left, oval.top, oval.width(), oval.height(), + left, top, right - left, bottom - top, -startAngle, -sweepAngle, Arc2D.OPEN), false); } @LayoutlibDelegate - /*package*/ static void native_addRoundRect( - long nPath, RectF rect, float rx, float ry, int dir) { + /*package*/ static void native_addRoundRect(long nPath, float left, float top, float right, + float bottom, float rx, float ry, int dir) { Path_Delegate pathDelegate = sManager.getDelegate(nPath); if (pathDelegate == null) { @@ -376,14 +377,15 @@ public final class Path_Delegate { } pathDelegate.mPath.append(new RoundRectangle2D.Float( - rect.left, rect.top, rect.width(), rect.height(), rx * 2, ry * 2), false); + left, top, right - left, bottom - top, rx * 2, ry * 2), false); } @LayoutlibDelegate - /*package*/ static void native_addRoundRect(long nPath, RectF rect, float[] radii, int dir) { + /*package*/ static void native_addRoundRect(long nPath, float left, float top, float right, + float bottom, float[] radii, int dir) { // Java2D doesn't support different rounded corners in each corner, so just use the // first value. - native_addRoundRect(nPath, rect, radii[0], radii[1], dir); + native_addRoundRect(nPath, left, top, right, bottom, radii[0], radii[1], dir); // there can be a case where this API is used but with similar values for all corners, so // in that case we don't warn. @@ -710,14 +712,19 @@ public final class Path_Delegate { * start of the arc. However, if the path is empty, then we call moveTo() * with the first point of the arc. The sweep angle is tread mod 360. * - * @param oval The bounds of oval defining shape and size of the arc + * @param left The left of oval defining shape and size of the arc + * @param top The top of oval defining shape and size of the arc + * @param right The right of oval defining shape and size of the arc + * @param bottom The bottom of oval defining shape and size of the arc * @param startAngle Starting angle (in degrees) where the arc begins * @param sweepAngle Sweep angle (in degrees) measured clockwise, treated * mod 360. * @param forceMoveTo If true, always begin a new contour with the arc */ - private void arcTo(RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo) { - Arc2D arc = new Arc2D.Float(oval.left, oval.top, oval.width(), oval.height(), -startAngle, + private void arcTo(float left, float top, float right, float bottom, float startAngle, + float sweepAngle, + boolean forceMoveTo) { + Arc2D arc = new Arc2D.Float(left, top, right - left, bottom - top, -startAngle, -sweepAngle, Arc2D.OPEN); mPath.append(arc, true /*connect*/); |