Expose Path.approximate()

It is a useful APIs that applications can benefit from for a
number of use cases. Since apps have currently no way of
inspecting the content of a path, this allows them to
perform interpolation along paths.

Change-Id: I79bcba38a0ed806c418ed25d36ea25af8721d9c1
This commit is contained in:
Romain Guy
2016-08-01 12:05:38 -07:00
parent b49c45bb08
commit 19e710e7b5
4 changed files with 3 additions and 1 deletions

View File

@@ -12295,6 +12295,7 @@ package android.graphics {
method public void addRoundRect(float, float, float, float, float, float, android.graphics.Path.Direction);
method public void addRoundRect(android.graphics.RectF, float[], android.graphics.Path.Direction);
method public void addRoundRect(float, float, float, float, float[], android.graphics.Path.Direction);
method public float[] approximate(float);
method public void arcTo(android.graphics.RectF, float, float, boolean);
method public void arcTo(android.graphics.RectF, float, float);
method public void arcTo(float, float, float, float, float, float, boolean);

View File

@@ -12726,6 +12726,7 @@ package android.graphics {
method public void addRoundRect(float, float, float, float, float, float, android.graphics.Path.Direction);
method public void addRoundRect(android.graphics.RectF, float[], android.graphics.Path.Direction);
method public void addRoundRect(float, float, float, float, float[], android.graphics.Path.Direction);
method public float[] approximate(float);
method public void arcTo(android.graphics.RectF, float, float, boolean);
method public void arcTo(android.graphics.RectF, float, float);
method public void arcTo(float, float, float, float, float, float, boolean);

View File

@@ -12309,6 +12309,7 @@ package android.graphics {
method public void addRoundRect(float, float, float, float, float, float, android.graphics.Path.Direction);
method public void addRoundRect(android.graphics.RectF, float[], android.graphics.Path.Direction);
method public void addRoundRect(float, float, float, float, float[], android.graphics.Path.Direction);
method public float[] approximate(float);
method public void arcTo(android.graphics.RectF, float, float, boolean);
method public void arcTo(android.graphics.RectF, float, float);
method public void arcTo(float, float, float, float, float, float, boolean);

View File

@@ -800,7 +800,6 @@ public class Path {
* Path. Typically this would be 0.5 so that
* the error is less than half a pixel.
* @return An array of components for points approximating the Path.
* @hide
*/
public float[] approximate(float acceptableError) {
return native_approximate(mNativePath, acceptableError);