Skip to content

Commit 8564be6

Browse files
Alex SakhartchoukAndroid (Google) Code Review
authored andcommitted
Merge "Breaking up rs headers by logical components."
2 parents 8879689 + 79c23f0 commit 8564be6

File tree

6 files changed

+480
-123
lines changed

6 files changed

+480
-123
lines changed

libs/rs/scriptc/rs_allocation.rsh

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -175,129 +175,6 @@ extern const void * __attribute__((overloadable))
175175
extern rs_element __attribute__((overloadable))
176176
rsAllocationGetElement(rs_allocation a);
177177

178-
/**
179-
* @param m mesh to get data from
180-
* @return number of allocations in the mesh that contain vertex
181-
* data
182-
*/
183-
extern uint32_t __attribute__((overloadable))
184-
rsMeshGetVertexAllocationCount(rs_mesh m);
185-
186-
/**
187-
* @param m mesh to get data from
188-
* @return number of primitive groups in the mesh. This would
189-
* include simple primitives as well as allocations
190-
* containing index data
191-
*/
192-
extern uint32_t __attribute__((overloadable))
193-
rsMeshGetPrimitiveCount(rs_mesh m);
194-
195-
/**
196-
* @param m mesh to get data from
197-
* @param index index of the vertex allocation
198-
* @return allocation containing vertex data
199-
*/
200-
extern rs_allocation __attribute__((overloadable))
201-
rsMeshGetVertexAllocation(rs_mesh m, uint32_t index);
202-
203-
/**
204-
* @param m mesh to get data from
205-
* @param index index of the index allocation
206-
* @return allocation containing index data
207-
*/
208-
extern rs_allocation __attribute__((overloadable))
209-
rsMeshGetIndexAllocation(rs_mesh m, uint32_t index);
210-
211-
/**
212-
* @param m mesh to get data from
213-
* @param index index of the primitive
214-
* @return primitive describing how the mesh is rendered
215-
*/
216-
extern rs_primitive __attribute__((overloadable))
217-
rsMeshGetPrimitive(rs_mesh m, uint32_t index);
218-
219-
/**
220-
* @param e element to get data from
221-
* @return number of sub-elements in this element
222-
*/
223-
extern uint32_t __attribute__((overloadable))
224-
rsElementGetSubElementCount(rs_element e);
225-
226-
/**
227-
* @param e element to get data from
228-
* @param index index of the sub-element to return
229-
* @return sub-element in this element at given index
230-
*/
231-
extern rs_element __attribute__((overloadable))
232-
rsElementGetSubElement(rs_element, uint32_t index);
233-
234-
/**
235-
* @param e element to get data from
236-
* @param index index of the sub-element to return
237-
* @return length of the sub-element name including the null
238-
* terminator (size of buffer needed to write the name)
239-
*/
240-
extern uint32_t __attribute__((overloadable))
241-
rsElementGetSubElementNameLength(rs_element e, uint32_t index);
242-
243-
/**
244-
* @param e element to get data from
245-
* @param index index of the sub-element
246-
* @param name array to store the name into
247-
* @param nameLength length of the provided name array
248-
* @return number of characters actually written, excluding the
249-
* null terminator
250-
*/
251-
extern uint32_t __attribute__((overloadable))
252-
rsElementGetSubElementName(rs_element e, uint32_t index, char *name, uint32_t nameLength);
253-
254-
/**
255-
* @param e element to get data from
256-
* @param index index of the sub-element
257-
* @return array size of sub-element in this element at given
258-
* index
259-
*/
260-
extern uint32_t __attribute__((overloadable))
261-
rsElementGetSubElementArraySize(rs_element e, uint32_t index);
262-
263-
/**
264-
* @param e element to get data from
265-
* @param index index of the sub-element
266-
* @return offset in bytes of sub-element in this element at
267-
* given index
268-
*/
269-
extern uint32_t __attribute__((overloadable))
270-
rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index);
271-
272-
/**
273-
* @param e element to get data from
274-
* @return total size of the element in bytes
275-
*/
276-
extern uint32_t __attribute__((overloadable))
277-
rsElementGetSizeBytes(rs_element e);
278-
279-
/**
280-
* @param e element to get data from
281-
* @return element's data type
282-
*/
283-
extern rs_data_type __attribute__((overloadable))
284-
rsElementGetDataType(rs_element e);
285-
286-
/**
287-
* @param e element to get data from
288-
* @return element's data size
289-
*/
290-
extern rs_data_kind __attribute__((overloadable))
291-
rsElementGetDataKind(rs_element e);
292-
293-
/**
294-
* @param e element to get data from
295-
* @return length of the element vector (for float2, float3,
296-
* etc.)
297-
*/
298-
extern uint32_t __attribute__((overloadable))
299-
rsElementGetVectorSize(rs_element e);
300-
301178
/**
302179
* Fetch allocation in a way described by the sampler
303180
* @param a 1D allocation to sample from

libs/rs/scriptc/rs_core.rsh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@
3131
#include "rs_atomic.rsh"
3232
#include "rs_cl.rsh"
3333
#include "rs_debug.rsh"
34+
#include "rs_element.rsh"
3435
#include "rs_math.rsh"
36+
#include "rs_mesh.rsh"
3537
#include "rs_matrix.rsh"
3638
#include "rs_object.rsh"
39+
#include "rs_program.rsh"
3740
#include "rs_quaternion.rsh"
41+
#include "rs_sampler.rsh"
3842
#include "rs_time.rsh"
3943

4044

libs/rs/scriptc/rs_element.rsh

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
/*
2+
* Copyright (C) 2012 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+
/*! \mainpage notitle
18+
*
19+
* Renderscript is a high-performance runtime that provides graphics rendering and
20+
* compute operations at the native level. Renderscript code is compiled on devices
21+
* at runtime to allow platform-independence as well.
22+
* This reference documentation describes the Renderscript runtime APIs, which you
23+
* can utilize to write Renderscript code in C99. The Renderscript header
24+
* files are automatically included for you, except for the rs_graphics.rsh header. If
25+
* you are doing graphics rendering, include the graphics header file like this:
26+
*
27+
* <code>#include "rs_graphics.rsh"</code>
28+
*
29+
* To use Renderscript, you need to utilize the Renderscript runtime APIs documented here
30+
* as well as the Android framework APIs for Renderscript.
31+
* For documentation on the Android framework APIs, see the <a target="_parent" href=
32+
* "http://developer.android.com/reference/android/renderscript/package-summary.html">
33+
* android.renderscript</a> package reference.
34+
* For more information on how to develop with Renderscript and how the runtime and
35+
* Android framework APIs interact, see the <a target="_parent" href=
36+
* "http://developer.android.com/guide/topics/renderscript/index.html">Renderscript
37+
* developer guide</a> and the <a target="_parent" href=
38+
* "http://developer.android.com/resources/samples/RenderScript/index.html">
39+
* Renderscript samples</a>.
40+
*/
41+
42+
/** @file rs_element.rsh
43+
* \brief Element routines
44+
*
45+
*
46+
*/
47+
48+
#ifndef __RS_ELEMENT_RSH__
49+
#define __RS_ELEMENT_RSH__
50+
51+
/**
52+
* @param e element to get data from
53+
* @return number of sub-elements in this element
54+
*/
55+
extern uint32_t __attribute__((overloadable))
56+
rsElementGetSubElementCount(rs_element e);
57+
58+
/**
59+
* @param e element to get data from
60+
* @param index index of the sub-element to return
61+
* @return sub-element in this element at given index
62+
*/
63+
extern rs_element __attribute__((overloadable))
64+
rsElementGetSubElement(rs_element, uint32_t index);
65+
66+
/**
67+
* @param e element to get data from
68+
* @param index index of the sub-element to return
69+
* @return length of the sub-element name including the null
70+
* terminator (size of buffer needed to write the name)
71+
*/
72+
extern uint32_t __attribute__((overloadable))
73+
rsElementGetSubElementNameLength(rs_element e, uint32_t index);
74+
75+
/**
76+
* @param e element to get data from
77+
* @param index index of the sub-element
78+
* @param name array to store the name into
79+
* @param nameLength length of the provided name array
80+
* @return number of characters actually written, excluding the
81+
* null terminator
82+
*/
83+
extern uint32_t __attribute__((overloadable))
84+
rsElementGetSubElementName(rs_element e, uint32_t index, char *name, uint32_t nameLength);
85+
86+
/**
87+
* @param e element to get data from
88+
* @param index index of the sub-element
89+
* @return array size of sub-element in this element at given
90+
* index
91+
*/
92+
extern uint32_t __attribute__((overloadable))
93+
rsElementGetSubElementArraySize(rs_element e, uint32_t index);
94+
95+
/**
96+
* @param e element to get data from
97+
* @param index index of the sub-element
98+
* @return offset in bytes of sub-element in this element at
99+
* given index
100+
*/
101+
extern uint32_t __attribute__((overloadable))
102+
rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index);
103+
104+
/**
105+
* @param e element to get data from
106+
* @return total size of the element in bytes
107+
*/
108+
extern uint32_t __attribute__((overloadable))
109+
rsElementGetSizeBytes(rs_element e);
110+
111+
/**
112+
* @param e element to get data from
113+
* @return element's data type
114+
*/
115+
extern rs_data_type __attribute__((overloadable))
116+
rsElementGetDataType(rs_element e);
117+
118+
/**
119+
* @param e element to get data from
120+
* @return element's data size
121+
*/
122+
extern rs_data_kind __attribute__((overloadable))
123+
rsElementGetDataKind(rs_element e);
124+
125+
/**
126+
* @param e element to get data from
127+
* @return length of the element vector (for float2, float3,
128+
* etc.)
129+
*/
130+
extern uint32_t __attribute__((overloadable))
131+
rsElementGetVectorSize(rs_element e);
132+
133+
#endif // __RS_ELEMENT_RSH__
134+

libs/rs/scriptc/rs_mesh.rsh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright (C) 2012 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+
/*! \mainpage notitle
18+
*
19+
* Renderscript is a high-performance runtime that provides graphics rendering and
20+
* compute operations at the native level. Renderscript code is compiled on devices
21+
* at runtime to allow platform-independence as well.
22+
* This reference documentation describes the Renderscript runtime APIs, which you
23+
* can utilize to write Renderscript code in C99. The Renderscript header
24+
* files are automatically included for you, except for the rs_graphics.rsh header. If
25+
* you are doing graphics rendering, include the graphics header file like this:
26+
*
27+
* <code>#include "rs_graphics.rsh"</code>
28+
*
29+
* To use Renderscript, you need to utilize the Renderscript runtime APIs documented here
30+
* as well as the Android framework APIs for Renderscript.
31+
* For documentation on the Android framework APIs, see the <a target="_parent" href=
32+
* "http://developer.android.com/reference/android/renderscript/package-summary.html">
33+
* android.renderscript</a> package reference.
34+
* For more information on how to develop with Renderscript and how the runtime and
35+
* Android framework APIs interact, see the <a target="_parent" href=
36+
* "http://developer.android.com/guide/topics/renderscript/index.html">Renderscript
37+
* developer guide</a> and the <a target="_parent" href=
38+
* "http://developer.android.com/resources/samples/RenderScript/index.html">
39+
* Renderscript samples</a>.
40+
*/
41+
42+
/** @file rs_mesh.rsh
43+
* \brief Mesh routines
44+
*
45+
*
46+
*/
47+
48+
#ifndef __RS_MESH_RSH__
49+
#define __RS_MESH_RSH__
50+
51+
/**
52+
* @param m mesh to get data from
53+
* @return number of allocations in the mesh that contain vertex
54+
* data
55+
*/
56+
extern uint32_t __attribute__((overloadable))
57+
rsMeshGetVertexAllocationCount(rs_mesh m);
58+
59+
/**
60+
* @param m mesh to get data from
61+
* @return number of primitive groups in the mesh. This would
62+
* include simple primitives as well as allocations
63+
* containing index data
64+
*/
65+
extern uint32_t __attribute__((overloadable))
66+
rsMeshGetPrimitiveCount(rs_mesh m);
67+
68+
/**
69+
* @param m mesh to get data from
70+
* @param index index of the vertex allocation
71+
* @return allocation containing vertex data
72+
*/
73+
extern rs_allocation __attribute__((overloadable))
74+
rsMeshGetVertexAllocation(rs_mesh m, uint32_t index);
75+
76+
/**
77+
* @param m mesh to get data from
78+
* @param index index of the index allocation
79+
* @return allocation containing index data
80+
*/
81+
extern rs_allocation __attribute__((overloadable))
82+
rsMeshGetIndexAllocation(rs_mesh m, uint32_t index);
83+
84+
/**
85+
* @param m mesh to get data from
86+
* @param index index of the primitive
87+
* @return primitive describing how the mesh is rendered
88+
*/
89+
extern rs_primitive __attribute__((overloadable))
90+
rsMeshGetPrimitive(rs_mesh m, uint32_t index);
91+
92+
#endif // __RS_MESH_RSH__
93+

0 commit comments

Comments
 (0)