Merge "Update Path and RenderNode delegates to new API" into nyc-dev
This commit is contained in:
@@ -423,21 +423,13 @@ public final class Path_Delegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@LayoutlibDelegate
|
@LayoutlibDelegate
|
||||||
/*package*/ static void native_offset(long nPath, float dx, float dy, long dst_path) {
|
/*package*/ static void native_offset(long nPath, float dx, float dy) {
|
||||||
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
|
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
|
||||||
if (pathDelegate == null) {
|
if (pathDelegate == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// could be null if the int is 0;
|
pathDelegate.offset(dx, dy);
|
||||||
Path_Delegate dstDelegate = sManager.getDelegate(dst_path);
|
|
||||||
|
|
||||||
pathDelegate.offset(dx, dy, dstDelegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
@LayoutlibDelegate
|
|
||||||
/*package*/ static void native_offset(long nPath, float dx, float dy) {
|
|
||||||
native_offset(nPath, dx, dy, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LayoutlibDelegate
|
@LayoutlibDelegate
|
||||||
@@ -860,22 +852,15 @@ public final class Path_Delegate {
|
|||||||
*
|
*
|
||||||
* @param dx The amount in the X direction to offset the entire path
|
* @param dx The amount in the X direction to offset the entire path
|
||||||
* @param dy The amount in the Y direction to offset the entire path
|
* @param dy The amount in the Y direction to offset the entire path
|
||||||
* @param dst The translated path is written here. If this is null, then
|
|
||||||
* the original path is modified.
|
|
||||||
*/
|
*/
|
||||||
public void offset(float dx, float dy, Path_Delegate dst) {
|
public void offset(float dx, float dy) {
|
||||||
GeneralPath newPath = new GeneralPath();
|
GeneralPath newPath = new GeneralPath();
|
||||||
|
|
||||||
PathIterator iterator = mPath.getPathIterator(new AffineTransform(0, 0, dx, 0, 0, dy));
|
PathIterator iterator = mPath.getPathIterator(new AffineTransform(0, 0, dx, 0, 0, dy));
|
||||||
|
|
||||||
newPath.append(iterator, false /*connect*/);
|
newPath.append(iterator, false /*connect*/);
|
||||||
|
|
||||||
if (dst != null) {
|
|
||||||
dst.mPath = newPath;
|
|
||||||
} else {
|
|
||||||
mPath = newPath;
|
mPath = newPath;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform the points in this path by matrix, and write the answer
|
* Transform the points in this path by matrix, and write the answer
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class RenderNode_Delegate {
|
|||||||
private String mName;
|
private String mName;
|
||||||
|
|
||||||
@LayoutlibDelegate
|
@LayoutlibDelegate
|
||||||
/*package*/ static long nCreate(String name) {
|
/*package*/ static long nCreate(RenderNode thisRenderNode, String name) {
|
||||||
RenderNode_Delegate renderNodeDelegate = new RenderNode_Delegate();
|
RenderNode_Delegate renderNodeDelegate = new RenderNode_Delegate();
|
||||||
renderNodeDelegate.mName = name;
|
renderNodeDelegate.mName = name;
|
||||||
return sManager.addNewDelegate(renderNodeDelegate);
|
return sManager.addNewDelegate(renderNodeDelegate);
|
||||||
|
|||||||
Reference in New Issue
Block a user