Skip to content

Commit 00da68d

Browse files
Alex SakhartchoukAndroid (Google) Code Review
authored andcommitted
Merge "Wrapping new api's with proper RS_VERSION"
2 parents f8338c4 + dc60cc4 commit 00da68d

File tree

7 files changed

+48
-147
lines changed

7 files changed

+48
-147
lines changed

libs/rs/scriptc/rs_allocation.rsh

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

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-
4217
/** @file rs_allocation.rsh
4318
* \brief Allocation routines
4419
*
@@ -168,6 +143,8 @@ extern const void * __attribute__((overloadable))
168143
extern const void * __attribute__((overloadable))
169144
rsGetElementAt(rs_allocation, uint32_t x, uint32_t y, uint32_t z);
170145

146+
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
147+
171148
/**
172149
* @param a allocation to get data from
173150
* @return element describing allocation layout
@@ -216,26 +193,7 @@ extern const float4 __attribute__((overloadable))
216193
extern const float4 __attribute__((overloadable))
217194
rsSample(rs_allocation a, rs_sampler s, float2 location, float lod);
218195

219-
/**
220-
* Fetch allocation in a way described by the sampler
221-
* @param a 3D allocation to sample from
222-
* @param s sampler state
223-
* @param location to sample from
224-
*/
225-
extern const float4 __attribute__((overloadable))
226-
rsSample(rs_allocation a, rs_sampler s, float3 location);
227-
228-
/**
229-
* Fetch allocation in a way described by the sampler
230-
* @param a 3D allocation to sample from
231-
* @param s sampler state
232-
* @param location to sample from
233-
* @param lod mip level to sample from, for fractional values
234-
* mip levels will be interpolated if
235-
* RS_SAMPLER_LINEAR_MIP_LINEAR is used
236-
*/
237-
extern const float4 __attribute__((overloadable))
238-
rsSample(rs_allocation a, rs_sampler s, float3 location, float lod);
196+
#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
239197

240198
#endif
241199

libs/rs/scriptc/rs_core.rsh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@
1414
* limitations under the License.
1515
*/
1616

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+
1742
/** @file rs_core.rsh
1843
* \brief todo-jsams
1944
*

libs/rs/scriptc/rs_element.rsh

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

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-
4217
/** @file rs_element.rsh
4318
* \brief Element routines
4419
*
@@ -48,6 +23,8 @@
4823
#ifndef __RS_ELEMENT_RSH__
4924
#define __RS_ELEMENT_RSH__
5025

26+
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
27+
5128
/**
5229
* @param e element to get data from
5330
* @return number of sub-elements in this element
@@ -130,5 +107,7 @@ extern rs_data_kind __attribute__((overloadable))
130107
extern uint32_t __attribute__((overloadable))
131108
rsElementGetVectorSize(rs_element e);
132109

110+
#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
111+
133112
#endif // __RS_ELEMENT_RSH__
134113

libs/rs/scriptc/rs_mesh.rsh

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

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-
4217
/** @file rs_mesh.rsh
4318
* \brief Mesh routines
4419
*
@@ -48,6 +23,8 @@
4823
#ifndef __RS_MESH_RSH__
4924
#define __RS_MESH_RSH__
5025

26+
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
27+
5128
/**
5229
* @param m mesh to get data from
5330
* @return number of allocations in the mesh that contain vertex
@@ -89,5 +66,7 @@ extern rs_allocation __attribute__((overloadable))
8966
extern rs_primitive __attribute__((overloadable))
9067
rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
9168

69+
#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
70+
9271
#endif // __RS_MESH_RSH__
9372

libs/rs/scriptc/rs_program.rsh

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

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-
4217
/** @file rs_program.rsh
4318
* \brief Program object routines
4419
*
@@ -48,6 +23,8 @@
4823
#ifndef __RS_PROGRAM_RSH__
4924
#define __RS_PROGRAM_RSH__
5025

26+
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
27+
5128
/**
5229
* @hide
5330
* Get program store depth function
@@ -146,7 +123,7 @@ extern bool __attribute__((overloadable))
146123
extern rs_cull_mode __attribute__((overloadable))
147124
rsgProgramRasterGetCullMode(rs_program_raster pr);
148125

149-
126+
#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
150127

151128
#endif // __RS_PROGRAM_RSH__
152129

libs/rs/scriptc/rs_sampler.rsh

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

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-
4217
/** @file rs_sampler.rsh
4318
* \brief Sampler routines
4419
*
@@ -48,6 +23,8 @@
4823
#ifndef __RS_SAMPLER_RSH__
4924
#define __RS_SAMPLER_RSH__
5025

26+
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
27+
5128
/**
5229
* @hide
5330
* Get sampler minification value
@@ -93,5 +70,7 @@ extern rs_sampler_value __attribute__((overloadable))
9370
extern float __attribute__((overloadable))
9471
rsSamplerGetAnisotropy(rs_sampler s);
9572

73+
#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
74+
9675
#endif // __RS_SAMPLER_RSH__
9776

libs/rs/scriptc/rs_types.rsh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ typedef enum {
402402

403403
#endif //defined(RS_VERSION) && (RS_VERSION >= 14)
404404

405+
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
406+
405407
/**
406408
* Describes the way mesh vertex data is interpreted when rendering
407409
*
@@ -552,4 +554,6 @@ typedef enum {
552554
RS_SAMPLER_INVALID = 100,
553555
} rs_sampler_value;
554556

555-
#endif
557+
#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
558+
559+
#endif // __RS_TYPES_RSH__

0 commit comments

Comments
 (0)