• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
20 using namespace android;
21 using namespace android::renderscript;
22 
23 
Path(Context * rsc)24 Path::Path(Context *rsc) : ObjectBase(rsc) {
25 }
26 
Path(Context * rsc,RsPathPrimitive pp,bool isStatic,Allocation * vtx,Allocation * loops,float quality)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 
35     //LOGE("i1");
36     rsc->mHal.funcs.path.initStatic(rsc, this, vtx, loops);
37 
38     //LOGE("i2");
39 }
40 
Path(Context * rsc,uint32_t vertexBuffersCount,uint32_t primitivesCount)41 Path::Path(Context *rsc, uint32_t vertexBuffersCount, uint32_t primitivesCount)
42 : ObjectBase(rsc) {
43 
44 }
45 
~Path()46 Path::~Path() {
47 
48 }
49 
50 
rasterize(const BezierSegment_t * s,uint32_t num,Allocation * alloc)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 
render(Context * rsc)59 void Path::render(Context *rsc) {
60 }
61 
serialize(Context * rsc,OStream * stream) const62 void Path::serialize(Context *rsc, OStream *stream) const {
63 
64 }
65 
getClassId() const66 RsA3DClassID Path::getClassId() const {
67     return RS_A3D_CLASS_ID_UNKNOWN;
68 }
69 
70 namespace android {
71 namespace renderscript {
72 
rsi_PathCreate(Context * rsc,RsPathPrimitive pp,bool isStatic,RsAllocation vtx,RsAllocation loops,float quality)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 }
80