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" |
Alex Sakhartchouk | 4edf030 | 2012-03-09 10:47:27 -0800 | [diff] [blame] | 18 | #include "rs.h" |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 19 | |
| 20 | using namespace android; |
| 21 | using namespace android::renderscript; |
| 22 | |
| 23 | |
| 24 | Path::Path(Context *rsc) : ObjectBase(rsc) { |
| 25 | } |
| 26 | |
| 27 | Path::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 | |
Jason Sams | 028f20a | 2012-01-10 15:42:54 -0800 | [diff] [blame] | 35 | //LOGE("i1"); |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 36 | rsc->mHal.funcs.path.initStatic(rsc, this, vtx, loops); |
| 37 | |
Jason Sams | 028f20a | 2012-01-10 15:42:54 -0800 | [diff] [blame] | 38 | //LOGE("i2"); |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | Path::Path(Context *rsc, uint32_t vertexBuffersCount, uint32_t primitivesCount) |
| 42 | : ObjectBase(rsc) { |
| 43 | |
| 44 | } |
| 45 | |
| 46 | Path::~Path() { |
| 47 | |
| 48 | } |
| 49 | |
| 50 | |
| 51 | void 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 | |
| 59 | void Path::render(Context *rsc) { |
| 60 | } |
| 61 | |
Jason Sams | e3150cf | 2012-07-24 18:10:20 -0700 | [diff] [blame] | 62 | void Path::serialize(Context *rsc, OStream *stream) const { |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 63 | |
| 64 | } |
| 65 | |
| 66 | RsA3DClassID Path::getClassId() const { |
| 67 | return RS_A3D_CLASS_ID_UNKNOWN; |
| 68 | } |
| 69 | |
| 70 | namespace android { |
| 71 | namespace renderscript { |
| 72 | |
| 73 | RsPath 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 | } |