blob: bcf4b8e79ef8ef5f2cae02e8718fbad5be52ae27 [file] [log] [blame]
Jason Sams9e0afb52011-10-31 13:23:43 -07001/*
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 Sakhartchouk4edf0302012-03-09 10:47:27 -080018#include "rs.h"
Jason Sams9e0afb52011-10-31 13:23:43 -070019
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
Jason Sams028f20a2012-01-10 15:42:54 -080035 //LOGE("i1");
Jason Sams9e0afb52011-10-31 13:23:43 -070036 rsc->mHal.funcs.path.initStatic(rsc, this, vtx, loops);
37
Jason Sams028f20a2012-01-10 15:42:54 -080038 //LOGE("i2");
Jason Sams9e0afb52011-10-31 13:23:43 -070039}
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
Jason Samse3150cf2012-07-24 18:10:20 -070062void Path::serialize(Context *rsc, OStream *stream) const {
Jason Sams9e0afb52011-10-31 13:23:43 -070063
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}