blob: f90a4f4526bb93d9f6a0956ea2cf019b0c01f03e [file] [log] [blame]
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07001#
2# Copyright (C) 2015 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
17header:
18summary: RenderScript graphics API
19description:
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070020 NOTE: RenderScript Graphics has been deprecated. Do not use.
21
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070022 A set of graphics functions used by RenderScript.
23include:
24 #ifdef __LP64__
25 // TODO We need to fix some of the builds before enabling this error:
26 // #error "RenderScript graphics is deprecated and not supported in 64bit mode."
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070027 #endif
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070028
29 // TODO we seem to assume order for the other headers too.
30 #include "rs_object_types.rsh"
31end:
32
33type: rs_blend_src_func
34version: 16
35size: 32
36enum:
37value: RS_BLEND_SRC_ZERO = 0
38value: RS_BLEND_SRC_ONE = 1
39value: RS_BLEND_SRC_DST_COLOR = 2
40value: RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3
41value: RS_BLEND_SRC_SRC_ALPHA = 4
42value: RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5
43value: RS_BLEND_SRC_DST_ALPHA = 6
44value: RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7
45value: RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8
46value: RS_BLEND_SRC_INVALID = 100
47summary: Blend source function
48description:
49end:
50
51type: rs_blend_dst_func
52version: 16
53size: 32
54enum:
55value: RS_BLEND_DST_ZERO = 0
56value: RS_BLEND_DST_ONE = 1
57value: RS_BLEND_DST_SRC_COLOR = 2
58value: RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3
59value: RS_BLEND_DST_SRC_ALPHA = 4
60value: RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5
61value: RS_BLEND_DST_DST_ALPHA = 6
62value: RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7
63value: RS_BLEND_DST_INVALID = 100
64summary: Blend destination function
65description:
66end:
67
68type: rs_cull_mode
69version: 16
70size: 32
71enum:
72value: RS_CULL_BACK = 0
73value: RS_CULL_FRONT = 1
74value: RS_CULL_NONE = 2
75value: RS_CULL_INVALID = 100
76summary: Culling mode
77description:
78end:
79
80type: rs_depth_func
81version: 16
82size: 32
83enum:
84value: RS_DEPTH_FUNC_ALWAYS = 0, "Always drawn"
85value: RS_DEPTH_FUNC_LESS = 1, "Drawn if the incoming depth value is less than that in the depth buffer"
86value: RS_DEPTH_FUNC_LEQUAL = 2, "Drawn if the incoming depth value is less or equal to that in the depth buffer"
87value: RS_DEPTH_FUNC_GREATER = 3, "Drawn if the incoming depth value is greater than that in the depth buffer"
88value: RS_DEPTH_FUNC_GEQUAL = 4, "Drawn if the incoming depth value is greater or equal to that in the depth buffer"
89value: RS_DEPTH_FUNC_EQUAL = 5, "Drawn if the incoming depth value is equal to that in the depth buffer"
90value: RS_DEPTH_FUNC_NOTEQUAL = 6, "Drawn if the incoming depth value is not equal to that in the depth buffer"
91value: RS_DEPTH_FUNC_INVALID = 100, "Invalid depth function"
92summary: Depth function
93description:
94 Specifies conditional drawing depending on the comparison of the incoming
95 depth to that found in the depth buffer.
96end:
97
98type: rs_primitive
99version: 16
100size: 32
101enum:
102value: RS_PRIMITIVE_POINT = 0, "Vertex data will be rendered as a series of points"
103value: RS_PRIMITIVE_LINE = 1, "Vertex pairs will be rendered as lines"
104value: RS_PRIMITIVE_LINE_STRIP = 2, "Vertex data will be rendered as a connected line strip"
105value: RS_PRIMITIVE_TRIANGLE = 3, "Vertices will be rendered as individual triangles"
106value: RS_PRIMITIVE_TRIANGLE_STRIP = 4, "Vertices will be rendered as a connected triangle strip defined by the first three vertices with each additional triangle defined by a new vertex"
107value: RS_PRIMITIVE_TRIANGLE_FAN = 5, "Vertices will be rendered as a sequence of triangles that all share first vertex as the origin"
108value: RS_PRIMITIVE_INVALID = 100, "Invalid primitive"
109summary: How to intepret mesh vertex data
110description:
111 Describes the way mesh vertex data is interpreted when rendering
112end:
113
114type: rs_font
115size: 32
116simple: _RS_HANDLE
117summary: Handle to a Font
118description:
119 Opaque handle to a RenderScript font object.
120 See: android.renderscript.Font
121end:
122
123
124type: rs_mesh
125size: 32
126simple: _RS_HANDLE
127summary: Handle to a Mesh
128description:
129 Opaque handle to a RenderScript mesh object.
130 See: android.renderscript.Mesh
131end:
132
133type: rs_program_fragment
134size: 32
135simple: _RS_HANDLE
136summary: Handle to a ProgramFragment
137description:
138 Opaque handle to a RenderScript ProgramFragment object.
139 See: android.renderscript.ProgramFragment
140end:
141
142type: rs_program_vertex
143size: 32
144simple: _RS_HANDLE
145summary: Handle to a ProgramVertex
146description:
147 Opaque handle to a RenderScript ProgramVertex object.
148 See: android.renderscript.ProgramVertex
149end:
150
151type: rs_program_raster
152size: 32
153simple: _RS_HANDLE
154summary: Handle to a ProgramRaster
155description:
156 Opaque handle to a RenderScript ProgramRaster object.
157 See: android.renderscript.ProgramRaster
158end:
159
160type: rs_program_store
161size: 32
162simple: _RS_HANDLE
163summary: Handle to a ProgramStore
164description:
165 Opaque handle to a RenderScript ProgramStore object.
166 See: android.renderscript.ProgramStore
167end:
168
169function: rsClearObject
170size: 32
171t: rs_mesh, rs_program_fragment, rs_program_vertex, rs_program_raster, rs_program_store, rs_font
172ret: void
173arg: #1* dst
174test: none
175end:
176
177function: rsIsObject
178size: 32
179t: rs_mesh, rs_program_fragment, rs_program_vertex, rs_program_raster, rs_program_store, rs_font
180ret: bool
181arg: #1 v
182test: none
183end:
184
185function: rsSetObject
186size: 32
187t: rs_mesh, rs_program_fragment, rs_program_vertex, rs_program_raster, rs_program_store, rs_font
188ret: void
189arg: #1* dst
190arg: #1 src
191test: none
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700192end:
193
194function: rsgAllocationSyncAll
195size: 32
196ret: void
197arg: rs_allocation alloc
198summary:
199description:
200 Sync the contents of an allocation.
201
202 If the source is specified, sync from memory space specified by source.
203
204 If the source is not specified, sync from its SCRIPT memory space to its HW
205 memory spaces.
206test: none
207end:
208
209function: rsgAllocationSyncAll
210version: 14
211size: 32
212ret: void
213arg: rs_allocation alloc
214arg: rs_allocation_usage_type source
215test: none
216end:
217
218function: rsgBindColorTarget
219version: 14
220size: 32
221ret: void
222arg: rs_allocation colorTarget
223arg: uint slot
224summary:
225description:
226 Set the color target used for all subsequent rendering calls
227test: none
228end:
229
230function: rsgBindConstant
231size: 32
232ret: void
233arg: rs_program_fragment ps, "program fragment object"
234arg: uint slot, "index of the constant buffer on the program"
235arg: rs_allocation c, "constants to bind"
236summary:
237description:
238 Bind a new Allocation object to a ProgramFragment or ProgramVertex.
239 The Allocation must be a valid constant input for the Program.
240test: none
241end:
242
243function: rsgBindConstant
244size: 32
245ret: void
246arg: rs_program_vertex pv, "program vertex object"
247arg: uint slot
248arg: rs_allocation c
249test: none
250end:
251
252function: rsgBindDepthTarget
253version: 14
254size: 32
255ret: void
256arg: rs_allocation depthTarget
257summary:
258description:
259 Set the depth target used for all subsequent rendering calls
260test: none
261end:
262
263function: rsgBindFont
264size: 32
265ret: void
266arg: rs_font font, "object to bind"
267summary:
268description:
269 Binds the font object to be used for all subsequent font rendering calls
270test: none
271end:
272
273function: rsgBindProgramFragment
274size: 32
275ret: void
276arg: rs_program_fragment pf
277summary:
278description:
279 Bind a new ProgramFragment to the rendering context.
280test: none
281end:
282
283function: rsgBindProgramRaster
284size: 32
285ret: void
286arg: rs_program_raster pr
287summary:
288description:
289 Bind a new ProgramRaster to the rendering context.
290test: none
291end:
292
293function: rsgBindProgramStore
294size: 32
295ret: void
296arg: rs_program_store ps
297summary:
298description:
299 Bind a new ProgramStore to the rendering context.
300test: none
301end:
302
303function: rsgBindProgramVertex
304size: 32
305ret: void
306arg: rs_program_vertex pv
307summary:
308description:
309 Bind a new ProgramVertex to the rendering context.
310test: none
311end:
312
313function: rsgBindSampler
314size: 32
315ret: void
316arg: rs_program_fragment fragment
317arg: uint slot
318arg: rs_sampler sampler
319summary:
320description:
321 Bind a new Sampler object to a ProgramFragment. The sampler will
322 operate on the texture bound at the matching slot.
323test: none
324end:
325
326function: rsgBindTexture
327size: 32
328ret: void
329arg: rs_program_fragment v
330arg: uint slot
331arg: rs_allocation alloc
332summary:
333description:
334 Bind a new Allocation object to a ProgramFragment. The
335 Allocation must be a valid texture for the Program. The sampling
336 of the texture will be controled by the Sampler bound at the
337 matching slot.
338test: none
339end:
340
341function: rsgClearAllRenderTargets
342version: 14
343size: 32
344ret: void
345summary:
346description:
347 Clear all color and depth targets and resume rendering into
348 the framebuffer
349test: none
350end:
351
352function: rsgClearColor
353size: 32
354ret: void
355arg: float r
356arg: float g
357arg: float b
358arg: float a
359summary:
360description:
361 Clears the rendering surface to the specified color.
362test: none
363end:
364
365function: rsgClearColorTarget
366version: 14
367size: 32
368ret: void
369arg: uint slot
370summary:
371description:
372 Clear the previously set color target
373test: none
374end:
375
376function: rsgClearDepth
377size: 32
378ret: void
379arg: float value
380summary:
381description:
382 Clears the depth suface to the specified value.
383test: none
384end:
385
386function: rsgClearDepthTarget
387version: 14
388size: 32
389ret: void
390summary:
391description:
392 Clear the previously set depth target
393test: none
394end:
395
396function: rsgDrawMesh
397size: 32
398ret: void
399arg: rs_mesh ism, "mesh object to render"
400summary:
401description:
402 Draw a mesh using the current context state.
403
404 If primitiveIndex is specified, draw part of a mesh using the current context state.
405
406 If start and len are also specified, draw specified index range of part of a mesh using the current context state.
407
408 Otherwise the whole mesh is rendered.
409test: none
410end:
411
412function: rsgDrawMesh
413size: 32
414ret: void
415arg: rs_mesh ism
416arg: uint primitiveIndex, "for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw."
417test: none
418end:
419
420function: rsgDrawMesh
421size: 32
422ret: void
423arg: rs_mesh ism
424arg: uint primitiveIndex
425arg: uint start, "starting index in the range"
426arg: uint len, "number of indices to draw"
427test: none
428end:
429
430function: rsgDrawQuad
431size: 32
432ret: void
433arg: float x1
434arg: float y1
435arg: float z1
436arg: float x2
437arg: float y2
438arg: float z2
439arg: float x3
440arg: float y3
441arg: float z3
442arg: float x4
443arg: float y4
444arg: float z4
445summary:
446description:
447 Low performance utility function for drawing a simple quad. Not intended for
448 drawing large quantities of geometry.
449test: none
450end:
451
452function: rsgDrawQuadTexCoords
453size: 32
454ret: void
455arg: float x1
456arg: float y1
457arg: float z1
458arg: float u1
459arg: float v1
460arg: float x2
461arg: float y2
462arg: float z2
463arg: float u2
464arg: float v2
465arg: float x3
466arg: float y3
467arg: float z3
468arg: float u3
469arg: float v3
470arg: float x4
471arg: float y4
472arg: float z4
473arg: float u4
474arg: float v4
475summary:
476description:
477 Low performance utility function for drawing a textured quad. Not intended
478 for drawing large quantities of geometry.
479test: none
480end:
481
482function: rsgDrawRect
483size: 32
484ret: void
485arg: float x1
486arg: float y1
487arg: float x2
488arg: float y2
489arg: float z
490summary:
491description:
492 Low performance utility function for drawing a simple rectangle. Not
493 intended for drawing large quantities of geometry.
494test: none
495end:
496
497function: rsgDrawSpriteScreenspace
498size: 32
499ret: void
500arg: float x
501arg: float y
502arg: float z
503arg: float w
504arg: float h
505summary:
506description:
507 Low performance function for drawing rectangles in screenspace. This
508 function uses the default passthough ProgramVertex. Any bound ProgramVertex
509 is ignored. This function has considerable overhead and should not be used
510 for drawing in shipping applications.
511test: none
512end:
513
514function: rsgDrawText
515size: 32
516ret: void
517arg: const char* text
518arg: int x
519arg: int y
520summary:
521description:
522 Draws text given a string and location
523test: none
524end:
525
526function: rsgDrawText
527size: 32
528ret: void
529arg: rs_allocation alloc
530arg: int x
531arg: int y
532test: none
533end:
534
535function: rsgFinish
536version: 14
537size: 32
538ret: uint
539summary:
540description:
541 Force RenderScript to finish all rendering commands
542test: none
543end:
544
545function: rsgFontColor
546size: 32
547ret: void
548arg: float r, "red component"
549arg: float g, "green component"
550arg: float b, "blue component"
551arg: float a, "alpha component"
552summary:
553description:
554 Sets the font color for all subsequent rendering calls
555test: none
556end:
557
558function: rsgGetHeight
559size: 32
560ret: uint
561summary:
562description:
563 Get the height of the current rendering surface.
564test: none
565end:
566
567function: rsgGetWidth
568size: 32
569ret: uint
570summary:
571description:
572 Get the width of the current rendering surface.
573test: none
574end:
575
576function: rsgMeasureText
577size: 32
578ret: void
579arg: const char* text
580arg: int* left
581arg: int* right
582arg: int* top
583arg: int* bottom
584summary:
585description:
586 Returns the bounding box of the text relative to (0, 0)
587 Any of left, right, top, bottom could be NULL
588test: none
589end:
590
591function: rsgMeasureText
592size: 32
593ret: void
594arg: rs_allocation alloc
595arg: int* left
596arg: int* right
597arg: int* top
598arg: int* bottom
599test: none
600end:
601
602function: rsgMeshComputeBoundingBox
603size: 32
604ret: void
605arg: rs_mesh mesh
606arg: float* minX
607arg: float* minY
608arg: float* min
609arg: float* maxX
610arg: float* maxY
611arg: float* maxZ
612summary:
613description:
614 Computes an axis aligned bounding box of a mesh object
615test: none
616end:
617
618function: rsgMeshComputeBoundingBox
619size: 32
620attrib: always_inline
621ret: void
622arg: rs_mesh mesh
623arg: float3* bBoxMin
624arg: float3* bBoxMax
625inline:
626 float x1, y1, z1, x2, y2, z2;
627 rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2);
628 bBoxMin->x = x1;
629 bBoxMin->y = y1;
630 bBoxMin->z = z1;
631 bBoxMax->x = x2;
632 bBoxMax->y = y2;
633 bBoxMax->z = z2;
634test: none
635end:
636
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700637function: rsgMeshGetIndexAllocation
638version: 16
639size: 32
640ret: rs_allocation, "allocation containing index data"
641arg: rs_mesh m, "mesh to get data from"
642arg: uint32_t index, "index of the index allocation"
643summary:
644description:
645 Returns an allocation containing index data or a null
646 allocation if only the primitive is specified
647test: none
648end:
649
650function: rsgMeshGetPrimitive
651version: 16
652size: 32
653ret: rs_primitive, "primitive describing how the mesh is rendered"
654arg: rs_mesh m, "mesh to get data from"
655arg: uint32_t index, "index of the primitive"
656summary:
657description:
658 Returns the primitive describing how a part of the mesh is
659 rendered
660test: none
661end:
662
663function: rsgMeshGetPrimitiveCount
664version: 16
665size: 32
666ret: uint32_t, "number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data"
667arg: rs_mesh m, "mesh to get data from"
668summary:
669description:
670 Meshes could have multiple index sets, this function returns
671 the number.
672test: none
673end:
674
675function: rsgMeshGetVertexAllocation
676version: 16
677size: 32
678ret: rs_allocation, "allocation containing vertex data"
679arg: rs_mesh m, "mesh to get data from"
680arg: uint32_t index, "index of the vertex allocation"
681summary:
682description:
683 Returns an allocation that is part of the mesh and contains
684 vertex data, e.g. positions, normals, texcoords
685test: none
686end:
687
688function: rsgMeshGetVertexAllocationCount
689version: 16
690size: 32
691ret: uint32_t, "number of allocations in the mesh that contain vertex data"
692arg: rs_mesh m, "mesh to get data from"
693summary:
694description:
695 Returns the number of allocations in the mesh that contain
696 vertex data
697test: none
698end:
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700699
700function: rsgProgramFragmentConstantColor
701size: 32
702ret: void
703arg: rs_program_fragment pf
704arg: float r
705arg: float g
706arg: float b
707arg: float a
708summary:
709description:
710 Set the constant color for a fixed function emulation program.
711test: none
712end:
713
714function: rsgProgramVertexGetProjectionMatrix
715size: 32
716ret: void
717arg: rs_matrix4x4* proj, "matrix to store the current projection matrix into"
718summary:
719description:
720 Get the projection matrix for a currently bound fixed function
721 vertex program. Calling this function with a custom vertex shader
722 would result in an error.
723test: none
724end:
725
726function: rsgProgramVertexLoadModelMatrix
727size: 32
728ret: void
729arg: const rs_matrix4x4* model, "model matrix"
730summary:
731description:
732 Load the model matrix for a currently bound fixed function
733 vertex program. Calling this function with a custom vertex shader
734 would result in an error.
735test: none
736end:
737
738function: rsgProgramVertexLoadProjectionMatrix
739size: 32
740ret: void
741arg: const rs_matrix4x4* proj, "projection matrix"
742summary:
743description:
744 Load the projection matrix for a currently bound fixed function
745 vertex program. Calling this function with a custom vertex shader
746 would result in an error.
747test: none
748end:
749
750function: rsgProgramVertexLoadTextureMatrix
751size: 32
752ret: void
753arg: const rs_matrix4x4* tex, "texture matrix"
754summary:
755description:
756 Load the texture matrix for a currently bound fixed function
757 vertex program. Calling this function with a custom vertex shader
758 would result in an error.
759test: none
760end:
761
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700762function: rsgProgramRasterGetCullMode
763version: 16
764size: 32
765ret: rs_cull_mode
766arg: rs_program_raster pr, "program raster to query"
767summary:
768description:
769 Get program raster cull mode
770test: none
771end:
772
773function: rsgProgramRasterIsPointSpriteEnabled
774version: 16
775size: 32
776ret: bool
777arg: rs_program_raster pr, "program raster to query"
778summary:
779description:
780 Get program raster point sprite state
781test: none
782end:
783
784function: rsgProgramStoreGetBlendDstFunc
785version: 16
786size: 32
787ret: rs_blend_dst_func
788arg: rs_program_store ps, "program store to query"
789summary:
790description:
791 Get program store blend destination function
792test: none
793end:
794
795function: rsgProgramStoreGetBlendSrcFunc
796version: 16
797size: 32
798ret: rs_blend_src_func
799arg: rs_program_store ps, "program store to query"
800summary:
801description:
802 Get program store blend source function
803test: none
804end:
805
806function: rsgProgramStoreGetDepthFunc
807version: 16
808size: 32
809ret: rs_depth_func
810arg: rs_program_store ps, "program store to query"
811summary:
812description:
813 Get program store depth function
814test: none
815end:
816
817function: rsgProgramStoreIsColorMaskAlphaEnabled
818version: 16
819size: 32
820ret: bool
821arg: rs_program_store ps, "program store to query"
822summary:
823description:
824 Get program store alpha component color mask
825test: none
826end:
827
828function: rsgProgramStoreIsColorMaskBlueEnabled
829version: 16
830size: 32
831ret: bool
832arg: rs_program_store ps, "program store to query"
833summary:
834description:
835 Get program store blur component color mask
836test: none
837end:
838
839function: rsgProgramStoreIsColorMaskGreenEnabled
840version: 16
841size: 32
842ret: bool
843arg: rs_program_store ps, "program store to query"
844summary:
845description:
846 Get program store green component color mask
847test: none
848end:
849
850function: rsgProgramStoreIsColorMaskRedEnabled
851version: 16
852size: 32
853ret: bool
854arg: rs_program_store ps, "program store to query"
855summary:
856description:
857 Get program store red component color mask
858test: none
859end:
860
861function: rsgProgramStoreIsDepthMaskEnabled
862version: 16
863size: 32
864ret: bool
865arg: rs_program_store ps, "program store to query"
866summary:
867description:
868 Get program store depth mask
869test: none
870end:
871
872function: rsgProgramStoreIsDitherEnabled
873version: 16
874size: 32
875ret: bool
876arg: rs_program_store ps, "program store to query"
877summary:
878description:
879 Get program store dither state
880test: none
881end: