diff options
author | Jason Sams <rjsams@android.com> | 2011-10-31 13:23:43 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2011-11-10 15:19:16 -0800 |
commit | f15ed0124ea7f7f87e4188a1dd15cc4917a62ee9 (patch) | |
tree | 3331398ede5e59c2c74905eb82cbe2b59c92b3c9 /graphics/java/android/renderscript/Path.java | |
parent | 137266978bc08cbd147ad46c23aa26a7fe64f0f7 (diff) |
Path rendering
Change-Id: I5379a676c9ec6a9b25f21bc1e050053f27e411dd
Diffstat (limited to 'graphics/java/android/renderscript/Path.java')
-rw-r--r-- | graphics/java/android/renderscript/Path.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/Path.java b/graphics/java/android/renderscript/Path.java new file mode 100644 index 000000000000..83ae150abd13 --- /dev/null +++ b/graphics/java/android/renderscript/Path.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.renderscript; + +import java.util.Vector; +import android.util.Log; + +/** + * @hide + * + */ +public class Path extends BaseObj { + + public enum Primitive { + QUADRATIC_BEZIER(0), + CUBIC_BEZIER(1); + + int mID; + Primitive(int id) { + mID = id; + } + } + + Allocation mVertexBuffer; + Allocation mLoopBuffer; + Primitive mPrimitive; + float mQuality; + boolean mCoverageToAlpha; + + Path(int id, RenderScript rs, Primitive p, Allocation vtx, Allocation loop, float q) { + super(id, rs); + mVertexBuffer = vtx; + mLoopBuffer = loop; + mPrimitive = p; + mQuality = q; + } + + public Allocation getVertexAllocation() { + return mVertexBuffer; + } + + public Allocation getLoopAllocation() { + return mLoopBuffer; + } + + public Primitive getPrimitive() { + return mPrimitive; + } + + @Override + void updateFromNative() { + } + + + public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx) { + int id = rs.nPathCreate(p.mID, false, vtx.getID(), 0, quality); + Path newPath = new Path(id, rs, p, null, null, quality); + return newPath; + } + + public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx, Allocation loops) { + return null; + } + + public static Path createDynamicPath(RenderScript rs, Primitive p, float quality, Allocation vtx) { + return null; + } + + public static Path createDynamicPath(RenderScript rs, Primitive p, float quality, Allocation vtx, Allocation loops) { + return null; + } + + +} + + |