1/* 2 * Copyright (C) 2011 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#include "rsContext.h" 18#include "rs.h" 19 20using namespace android; 21using namespace android::renderscript; 22 23 24Path::Path(Context *rsc) : ObjectBase(rsc) { 25} 26 27Path::Path(Context *rsc, RsPathPrimitive pp, bool isStatic, 28 Allocation *vtx, Allocation *loops, float quality) 29: ObjectBase(rsc) { 30 31 memset(&mHal, 0, sizeof(mHal)); 32 mHal.state.quality = quality; 33 mHal.state.primitive = pp; 34 35 //LOGE("i1"); 36 rsc->mHal.funcs.path.initStatic(rsc, this, vtx, loops); 37 38 //LOGE("i2"); 39} 40 41Path::Path(Context *rsc, uint32_t vertexBuffersCount, uint32_t primitivesCount) 42: ObjectBase(rsc) { 43 44} 45 46Path::~Path() { 47 48} 49 50 51void Path::rasterize(const BezierSegment_t *s, uint32_t num, Allocation *alloc) { 52 53 for (uint32_t i=0; i < num; i++) { 54 55 } 56 57} 58 59void Path::render(Context *rsc) { 60} 61 62void Path::serialize(Context *rsc, OStream *stream) const { 63 64} 65 66RsA3DClassID Path::getClassId() const { 67 return RS_A3D_CLASS_ID_UNKNOWN; 68} 69 70namespace android { 71namespace renderscript { 72 73RsPath rsi_PathCreate(Context *rsc, RsPathPrimitive pp, bool isStatic, 74 RsAllocation vtx, RsAllocation loops, float quality) { 75 return new Path(rsc, pp, isStatic, (Allocation *)vtx, (Allocation *)loops, quality); 76} 77 78} 79} 80