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