1/* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.renderscript; 18 19import java.util.Vector; 20import android.util.Log; 21 22/** 23 * @hide 24 * 25 */ 26public class Path extends BaseObj { 27 28 public enum Primitive { 29 QUADRATIC_BEZIER(0), 30 CUBIC_BEZIER(1); 31 32 int mID; 33 Primitive(int id) { 34 mID = id; 35 } 36 } 37 38 Allocation mVertexBuffer; 39 Allocation mLoopBuffer; 40 Primitive mPrimitive; 41 float mQuality; 42 boolean mCoverageToAlpha; 43 44 Path(int id, RenderScript rs, Primitive p, Allocation vtx, Allocation loop, float q) { 45 super(id, rs); 46 mVertexBuffer = vtx; 47 mLoopBuffer = loop; 48 mPrimitive = p; 49 mQuality = q; 50 } 51 52 public Allocation getVertexAllocation() { 53 return mVertexBuffer; 54 } 55 56 public Allocation getLoopAllocation() { 57 return mLoopBuffer; 58 } 59 60 public Primitive getPrimitive() { 61 return mPrimitive; 62 } 63 64 @Override 65 void updateFromNative() { 66 } 67 68 69 public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx) { 70 int id = rs.nPathCreate(p.mID, false, vtx.getID(rs), 0, quality); 71 Path newPath = new Path(id, rs, p, null, null, quality); 72 return newPath; 73 } 74 75 public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx, Allocation loops) { 76 return null; 77 } 78 79 public static Path createDynamicPath(RenderScript rs, Primitive p, float quality, Allocation vtx) { 80 return null; 81 } 82 83 public static Path createDynamicPath(RenderScript rs, Primitive p, float quality, Allocation vtx, Allocation loops) { 84 return null; 85 } 86 87 88} 89 90 91