Home | History | Annotate | Download | only in renderscript
      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 
     17 package android.renderscript;
     18 
     19 /**
     20  * @hide
     21  *
     22  */
     23 public class Path extends BaseObj {
     24 
     25     public enum Primitive {
     26         QUADRATIC_BEZIER(0),
     27         CUBIC_BEZIER(1);
     28 
     29         int mID;
     30         Primitive(int id) {
     31             mID = id;
     32         }
     33     }
     34 
     35     Allocation mVertexBuffer;
     36     Allocation mLoopBuffer;
     37     Primitive mPrimitive;
     38     float mQuality;
     39     boolean mCoverageToAlpha;
     40 
     41     Path(long id, RenderScript rs, Primitive p, Allocation vtx, Allocation loop, float q) {
     42         super(id, rs);
     43         mVertexBuffer = vtx;
     44         mLoopBuffer = loop;
     45         mPrimitive = p;
     46         mQuality = q;
     47     }
     48 
     49     public Allocation getVertexAllocation() {
     50         return mVertexBuffer;
     51     }
     52 
     53     public Allocation getLoopAllocation() {
     54         return mLoopBuffer;
     55     }
     56 
     57     public Primitive getPrimitive() {
     58         return mPrimitive;
     59     }
     60 
     61     @Override
     62     void updateFromNative() {
     63     }
     64 
     65 
     66     public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx) {
     67         long id = rs.nPathCreate(p.mID, false, vtx.getID(rs), 0, quality);
     68         Path newPath = new Path(id, rs, p, null, null, quality);
     69         return newPath;
     70     }
     71 
     72     public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx, Allocation loops) {
     73         return null;
     74     }
     75 
     76     public static Path createDynamicPath(RenderScript rs, Primitive p, float quality, Allocation vtx) {
     77         return null;
     78     }
     79 
     80     public static Path createDynamicPath(RenderScript rs, Primitive p, float quality, Allocation vtx, Allocation loops) {
     81         return null;
     82     }
     83 
     84 
     85 }
     86 
     87 
     88