2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 // Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
20 * rs_graphics.rsh: Graphics Functions and Types
22 * The graphics subsystem of RenderScript was removed at API level 23.
25 #ifndef RENDERSCRIPT_RS_GRAPHICS_RSH
26 #define RENDERSCRIPT_RS_GRAPHICS_RSH
29 // TODO We need to fix some of the builds before enabling this error:
30 // #error "RenderScript graphics is deprecated and not supported in 64bit mode."
33 // TODO we seem to assume order for the other headers too.
34 #include "rs_object_types.rsh"
37 * rs_blend_src_func: Blend source function
39 * DEPRECATED. Do not use.
43 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
44 typedef enum __attribute__((
45 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
49 RS_BLEND_SRC_ZERO = 0,
51 RS_BLEND_SRC_DST_COLOR = 2,
52 RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3,
53 RS_BLEND_SRC_SRC_ALPHA = 4,
54 RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5,
55 RS_BLEND_SRC_DST_ALPHA = 6,
56 RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7,
57 RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8,
58 RS_BLEND_SRC_INVALID = 100
64 * rs_blend_dst_func: Blend destination function
66 * DEPRECATED. Do not use.
70 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
71 typedef enum __attribute__((
72 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
76 RS_BLEND_DST_ZERO = 0,
78 RS_BLEND_DST_SRC_COLOR = 2,
79 RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3,
80 RS_BLEND_DST_SRC_ALPHA = 4,
81 RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5,
82 RS_BLEND_DST_DST_ALPHA = 6,
83 RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7,
84 RS_BLEND_DST_INVALID = 100
90 * rs_cull_mode: Culling mode
92 * DEPRECATED. Do not use.
96 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
97 typedef enum __attribute__((
98 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
105 RS_CULL_INVALID = 100
111 * rs_depth_func: Depth function
113 * DEPRECATED. Do not use.
115 * Specifies conditional drawing depending on the comparison of the incoming
116 * depth to that found in the depth buffer.
119 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
120 typedef enum __attribute__((
121 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
125 RS_DEPTH_FUNC_ALWAYS = 0, // Always drawn
126 RS_DEPTH_FUNC_LESS = 1, // Drawn if the incoming depth value is less than that in the depth buffer
127 RS_DEPTH_FUNC_LEQUAL = 2, // Drawn if the incoming depth value is less or equal to that in the depth buffer
128 RS_DEPTH_FUNC_GREATER = 3, // Drawn if the incoming depth value is greater than that in the depth buffer
129 RS_DEPTH_FUNC_GEQUAL = 4, // Drawn if the incoming depth value is greater or equal to that in the depth buffer
130 RS_DEPTH_FUNC_EQUAL = 5, // Drawn if the incoming depth value is equal to that in the depth buffer
131 RS_DEPTH_FUNC_NOTEQUAL = 6, // Drawn if the incoming depth value is not equal to that in the depth buffer
132 RS_DEPTH_FUNC_INVALID = 100 // Invalid depth function
138 * rs_primitive: How to intepret mesh vertex data
140 * DEPRECATED. Do not use.
142 * Describes the way mesh vertex data is interpreted when rendering
145 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
146 typedef enum __attribute__((
147 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
151 RS_PRIMITIVE_POINT = 0, // Vertex data will be rendered as a series of points
152 RS_PRIMITIVE_LINE = 1, // Vertex pairs will be rendered as lines
153 RS_PRIMITIVE_LINE_STRIP = 2, // Vertex data will be rendered as a connected line strip
154 RS_PRIMITIVE_TRIANGLE = 3, // Vertices will be rendered as individual triangles
155 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
156 RS_PRIMITIVE_TRIANGLE_FAN = 5, // Vertices will be rendered as a sequence of triangles that all share first vertex as the origin
157 RS_PRIMITIVE_INVALID = 100 // Invalid primitive
163 * rs_font: Handle to a Font
165 * DEPRECATED. Do not use.
167 * Opaque handle to a RenderScript font object.
168 * See: android.renderscript.Font
171 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
172 typedef struct rs_font _RS_OBJECT_DECL __attribute__((
173 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
181 * rs_mesh: Handle to a Mesh
183 * DEPRECATED. Do not use.
185 * Opaque handle to a RenderScript mesh object.
186 * See: android.renderscript.Mesh
189 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
190 typedef struct rs_mesh _RS_OBJECT_DECL __attribute__((
191 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
199 * rs_program_fragment: Handle to a ProgramFragment
201 * DEPRECATED. Do not use.
203 * Opaque handle to a RenderScript ProgramFragment object.
204 * See: android.renderscript.ProgramFragment
207 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
208 typedef struct rs_program_fragment _RS_OBJECT_DECL __attribute__((
209 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
212 )) rs_program_fragment;
217 * rs_program_vertex: Handle to a ProgramVertex
219 * DEPRECATED. Do not use.
221 * Opaque handle to a RenderScript ProgramVertex object.
222 * See: android.renderscript.ProgramVertex
225 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
226 typedef struct rs_program_vertex _RS_OBJECT_DECL __attribute__((
227 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
230 )) rs_program_vertex;
235 * rs_program_raster: Handle to a ProgramRaster
237 * DEPRECATED. Do not use.
239 * Opaque handle to a RenderScript ProgramRaster object.
240 * See: android.renderscript.ProgramRaster
243 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
244 typedef struct rs_program_raster _RS_OBJECT_DECL __attribute__((
245 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
248 )) rs_program_raster;
253 * rs_program_store: Handle to a ProgramStore
255 * DEPRECATED. Do not use.
257 * Opaque handle to a RenderScript ProgramStore object.
258 * See: android.renderscript.ProgramStore
261 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
262 typedef struct rs_program_store _RS_OBJECT_DECL __attribute__((
263 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
271 * rsClearObject: Release an object
273 * Tells the run time that this handle will no longer be used to access the the related
274 * object. If this was the last handle to that object, resource recovery may happen.
276 * After calling this function, *dst will be set to an empty handle. See rsIsObject().
279 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
280 extern void __attribute__((overloadable))
281 rsClearObject(rs_mesh* dst);
286 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
287 extern void __attribute__((overloadable))
288 rsClearObject(rs_program_fragment* dst);
293 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
294 extern void __attribute__((overloadable))
295 rsClearObject(rs_program_vertex* dst);
300 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
301 extern void __attribute__((overloadable))
302 rsClearObject(rs_program_raster* dst);
307 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
308 extern void __attribute__((overloadable))
309 rsClearObject(rs_program_store* dst);
314 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
315 extern void __attribute__((overloadable))
316 rsClearObject(rs_font* dst);
321 * rsIsObject: Check for an empty handle
323 * Returns true if the handle contains a non-null reference.
325 * This function does not validate that the internal pointer used in the handle
326 * points to an actual valid object; it only checks for null.
328 * This function can be used to check the Element returned by rsElementGetSubElement()
329 * or see if rsClearObject() has been called on a handle.
332 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
333 extern bool __attribute__((overloadable))
334 rsIsObject(rs_mesh v);
339 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
340 extern bool __attribute__((overloadable))
341 rsIsObject(rs_program_fragment v);
346 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
347 extern bool __attribute__((overloadable))
348 rsIsObject(rs_program_vertex v);
353 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
354 extern bool __attribute__((overloadable))
355 rsIsObject(rs_program_raster v);
360 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
361 extern bool __attribute__((overloadable))
362 rsIsObject(rs_program_store v);
367 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
368 extern bool __attribute__((overloadable))
369 rsIsObject(rs_font v);
374 * rsSetObject: For internal use.
378 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
379 extern void __attribute__((overloadable))
380 rsSetObject(rs_mesh* dst, rs_mesh src);
385 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
386 extern void __attribute__((overloadable))
387 rsSetObject(rs_program_fragment* dst, rs_program_fragment src);
392 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
393 extern void __attribute__((overloadable))
394 rsSetObject(rs_program_vertex* dst, rs_program_vertex src);
399 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
400 extern void __attribute__((overloadable))
401 rsSetObject(rs_program_raster* dst, rs_program_raster src);
406 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
407 extern void __attribute__((overloadable))
408 rsSetObject(rs_program_store* dst, rs_program_store src);
413 #if !defined(RS_VERSION) || (RS_VERSION <= 22)
414 extern void __attribute__((overloadable))
415 rsSetObject(rs_font* dst, rs_font src);
420 * rsgAllocationSyncAll: Sync the contents of an allocation
422 * DEPRECATED. Do not use.
424 * Sync the contents of an allocation.
426 * If the source is specified, sync from memory space specified by source.
428 * If the source is not specified, sync from its SCRIPT memory space to its HW
432 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
433 extern void __attribute__((overloadable
434 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
438 rsgAllocationSyncAll(rs_allocation alloc);
443 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
444 extern void __attribute__((overloadable
445 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
449 rsgAllocationSyncAll(rs_allocation alloc, rs_allocation_usage_type source);
454 * rsgBindColorTarget: Set the color target
456 * DEPRECATED. Do not use.
458 * Set the color target used for all subsequent rendering calls
461 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
462 extern void __attribute__((overloadable
463 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
467 rsgBindColorTarget(rs_allocation colorTarget, uint slot);
472 * rsgBindConstant: Bind a constant allocation
474 * DEPRECATED. Do not use.
476 * Bind a new Allocation object to a ProgramFragment or ProgramVertex.
477 * The Allocation must be a valid constant input for the Program.
480 * ps: program fragment object
481 * slot: index of the constant buffer on the program
482 * c: constants to bind
483 * pv: program vertex object
486 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
487 extern void __attribute__((overloadable
488 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
492 rsgBindConstant(rs_program_fragment ps, uint slot, rs_allocation c);
497 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
498 extern void __attribute__((overloadable
499 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
503 rsgBindConstant(rs_program_vertex pv, uint slot, rs_allocation c);
508 * rsgBindDepthTarget: Set the depth target
510 * DEPRECATED. Do not use.
512 * Set the depth target used for all subsequent rendering calls
515 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
516 extern void __attribute__((overloadable
517 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
521 rsgBindDepthTarget(rs_allocation depthTarget);
526 * rsgBindFont: Bind a font object
528 * DEPRECATED. Do not use.
530 * Binds the font object to be used for all subsequent font rendering calls
533 * font: object to bind
536 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
537 extern void __attribute__((overloadable
538 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
542 rsgBindFont(rs_font font);
547 * rsgBindProgramFragment: Bind a ProgramFragment
549 * DEPRECATED. Do not use.
551 * Bind a new ProgramFragment to the rendering context.
554 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
555 extern void __attribute__((overloadable
556 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
560 rsgBindProgramFragment(rs_program_fragment pf);
565 * rsgBindProgramRaster: Bind a ProgramRaster
567 * DEPRECATED. Do not use.
569 * Bind a new ProgramRaster to the rendering context.
572 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
573 extern void __attribute__((overloadable
574 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
578 rsgBindProgramRaster(rs_program_raster pr);
583 * rsgBindProgramStore: Bind a ProgramStore
585 * DEPRECATED. Do not use.
587 * Bind a new ProgramStore to the rendering context.
590 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
591 extern void __attribute__((overloadable
592 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
596 rsgBindProgramStore(rs_program_store ps);
601 * rsgBindProgramVertex: Bind a ProgramVertex
603 * DEPRECATED. Do not use.
605 * Bind a new ProgramVertex to the rendering context.
608 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
609 extern void __attribute__((overloadable
610 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
614 rsgBindProgramVertex(rs_program_vertex pv);
619 * rsgBindSampler: Bind a sampler
621 * DEPRECATED. Do not use.
623 * Bind a new Sampler object to a ProgramFragment. The sampler will
624 * operate on the texture bound at the matching slot.
627 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
628 extern void __attribute__((overloadable
629 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
633 rsgBindSampler(rs_program_fragment fragment, uint slot, rs_sampler sampler);
638 * rsgBindTexture: Bind a texture allocation
640 * DEPRECATED. Do not use.
642 * Bind a new Allocation object to a ProgramFragment. The
643 * Allocation must be a valid texture for the Program. The sampling
644 * of the texture will be controled by the Sampler bound at the
648 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
649 extern void __attribute__((overloadable
650 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
654 rsgBindTexture(rs_program_fragment v, uint slot, rs_allocation alloc);
659 * rsgClearAllRenderTargets: Clear all color and depth targets
661 * DEPRECATED. Do not use.
663 * Clear all color and depth targets and resume rendering into
667 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
668 extern void __attribute__((overloadable
669 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
673 rsgClearAllRenderTargets(void);
678 * rsgClearColor: Clear the specified color from the surface
680 * DEPRECATED. Do not use.
682 * Clears the rendering surface to the specified color.
685 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
686 extern void __attribute__((overloadable
687 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
691 rsgClearColor(float r, float g, float b, float a);
696 * rsgClearColorTarget: Clear the color target
698 * DEPRECATED. Do not use.
700 * Clear the previously set color target
703 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
704 extern void __attribute__((overloadable
705 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
709 rsgClearColorTarget(uint slot);
714 * rsgClearDepth: Clear the depth surface
716 * DEPRECATED. Do not use.
718 * Clears the depth suface to the specified value.
721 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
722 extern void __attribute__((overloadable
723 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
727 rsgClearDepth(float value);
732 * rsgClearDepthTarget: Clear the depth target
734 * DEPRECATED. Do not use.
736 * Clear the previously set depth target
739 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
740 extern void __attribute__((overloadable
741 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
745 rsgClearDepthTarget(void);
750 * rsgDrawMesh: Draw a mesh
752 * DEPRECATED. Do not use.
754 * Draw a mesh using the current context state.
756 * If primitiveIndex is specified, draw part of a mesh using the current context state.
758 * If start and len are also specified, draw specified index range of part of a mesh using the current context state.
760 * Otherwise the whole mesh is rendered.
763 * ism: mesh object to render
764 * primitiveIndex: for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw.
765 * start: starting index in the range
766 * len: number of indices to draw
769 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
770 extern void __attribute__((overloadable
771 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
775 rsgDrawMesh(rs_mesh ism);
780 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
781 extern void __attribute__((overloadable
782 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
786 rsgDrawMesh(rs_mesh ism, uint primitiveIndex);
791 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
792 extern void __attribute__((overloadable
793 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
797 rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len);
802 * rsgDrawQuad: Draw a quad
804 * DEPRECATED. Do not use.
806 * Low performance utility function for drawing a simple quad. Not intended for
807 * drawing large quantities of geometry.
810 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
811 extern void __attribute__((overloadable
812 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
816 rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3,
817 float z3, float x4, float y4, float z4);
822 * rsgDrawQuadTexCoords: Draw a textured quad
824 * DEPRECATED. Do not use.
826 * Low performance utility function for drawing a textured quad. Not intended
827 * for drawing large quantities of geometry.
830 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
831 extern void __attribute__((overloadable
832 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
836 rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2,
837 float z2, float u2, float v2, float x3, float y3, float z3, float u3,
838 float v3, float x4, float y4, float z4, float u4, float v4);
843 * rsgDrawRect: Draw a rectangle
845 * DEPRECATED. Do not use.
847 * Low performance utility function for drawing a simple rectangle. Not
848 * intended for drawing large quantities of geometry.
851 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
852 extern void __attribute__((overloadable
853 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
857 rsgDrawRect(float x1, float y1, float x2, float y2, float z);
862 * rsgDrawSpriteScreenspace: Draw rectangles in screenspace
864 * DEPRECATED. Do not use.
866 * Low performance function for drawing rectangles in screenspace. This
867 * function uses the default passthough ProgramVertex. Any bound ProgramVertex
868 * is ignored. This function has considerable overhead and should not be used
869 * for drawing in shipping applications.
872 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
873 extern void __attribute__((overloadable
874 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
878 rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h);
883 * rsgDrawText: Draw a text string
885 * DEPRECATED. Do not use.
887 * Draws text given a string and location
890 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
891 extern void __attribute__((overloadable
892 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
896 rsgDrawText(const char* text, int x, int y);
901 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
902 extern void __attribute__((overloadable
903 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
907 rsgDrawText(rs_allocation alloc, int x, int y);
912 * rsgFinish: End rendering commands
914 * DEPRECATED. Do not use.
916 * Force RenderScript to finish all rendering commands
919 #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
920 extern uint __attribute__((overloadable
921 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
930 * rsgFontColor: Set the font color
932 * DEPRECATED. Do not use.
934 * Sets the font color for all subsequent rendering calls
943 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
944 extern void __attribute__((overloadable
945 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
949 rsgFontColor(float r, float g, float b, float a);
954 * rsgGetHeight: Get the surface height
956 * DEPRECATED. Do not use.
958 * Get the height of the current rendering surface.
961 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
962 extern uint __attribute__((overloadable
963 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
972 * rsgGetWidth: Get the surface width
974 * DEPRECATED. Do not use.
976 * Get the width of the current rendering surface.
979 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
980 extern uint __attribute__((overloadable
981 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
990 * rsgMeasureText: Get the bounding box for a text string
992 * DEPRECATED. Do not use.
994 * Returns the bounding box of the text relative to (0, 0)
995 * Any of left, right, top, bottom could be NULL
998 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
999 extern void __attribute__((overloadable
1000 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1004 rsgMeasureText(const char* text, int* left, int* right, int* top, int* bottom);
1009 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1010 extern void __attribute__((overloadable
1011 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1015 rsgMeasureText(rs_allocation alloc, int* left, int* right, int* top, int* bottom);
1020 * rsgMeshComputeBoundingBox: Compute a bounding box
1022 * DEPRECATED. Do not use.
1024 * Computes an axis aligned bounding box of a mesh object
1027 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1028 extern void __attribute__((overloadable
1029 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1033 rsgMeshComputeBoundingBox(rs_mesh mesh, float* minX, float* minY, float* min, float* maxX,
1034 float* maxY, float* maxZ);
1039 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1040 static inline void __attribute__((overloadable
1041 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1045 rsgMeshComputeBoundingBox(rs_mesh mesh, float3* bBoxMin, float3* bBoxMax) {
1046 float x1, y1, z1, x2, y2, z2;
1047 rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2);
1059 * rsgMeshGetIndexAllocation: Return an allocation containing index data
1061 * DEPRECATED. Do not use.
1063 * Returns an allocation containing index data or a null
1064 * allocation if only the primitive is specified
1067 * m: mesh to get data from
1068 * index: index of the index allocation
1070 * Returns: allocation containing index data
1073 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1074 extern rs_allocation __attribute__((overloadable
1075 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1079 rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index);
1084 * rsgMeshGetPrimitive: Return the primitive
1086 * DEPRECATED. Do not use.
1088 * Returns the primitive describing how a part of the mesh is
1092 * m: mesh to get data from
1093 * index: index of the primitive
1095 * Returns: primitive describing how the mesh is rendered
1098 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1099 extern rs_primitive __attribute__((overloadable
1100 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1104 rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
1109 * rsgMeshGetPrimitiveCount: Return the number of index sets
1111 * DEPRECATED. Do not use.
1113 * Meshes could have multiple index sets, this function returns
1117 * m: mesh to get data from
1119 * Returns: number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data
1122 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1123 extern uint32_t __attribute__((overloadable
1124 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1128 rsgMeshGetPrimitiveCount(rs_mesh m);
1133 * rsgMeshGetVertexAllocation: Return a vertex allocation
1135 * DEPRECATED. Do not use.
1137 * Returns an allocation that is part of the mesh and contains
1138 * vertex data, e.g. positions, normals, texcoords
1141 * m: mesh to get data from
1142 * index: index of the vertex allocation
1144 * Returns: allocation containing vertex data
1147 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1148 extern rs_allocation __attribute__((overloadable
1149 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1153 rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index);
1158 * rsgMeshGetVertexAllocationCount: Return the number of vertex allocations
1160 * DEPRECATED. Do not use.
1162 * Returns the number of allocations in the mesh that contain
1166 * m: mesh to get data from
1168 * Returns: number of allocations in the mesh that contain vertex data
1171 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1172 extern uint32_t __attribute__((overloadable
1173 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1177 rsgMeshGetVertexAllocationCount(rs_mesh m);
1182 * rsgProgramFragmentConstantColor: Set the constant color for a fixed function emulation program
1184 * DEPRECATED. Do not use.
1186 * Set the constant color for a fixed function emulation program.
1189 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1190 extern void __attribute__((overloadable
1191 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1195 rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a);
1200 * rsgProgramVertexGetProjectionMatrix: Get the projection matrix for a fixed function vertex program
1202 * DEPRECATED. Do not use.
1204 * Get the projection matrix for a currently bound fixed function
1205 * vertex program. Calling this function with a custom vertex shader
1206 * would result in an error.
1209 * proj: matrix to store the current projection matrix into
1212 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1213 extern void __attribute__((overloadable
1214 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1218 rsgProgramVertexGetProjectionMatrix(rs_matrix4x4* proj);
1223 * rsgProgramVertexLoadModelMatrix: Load the model matrix for a bound fixed function vertex program
1225 * DEPRECATED. Do not use.
1227 * Load the model matrix for a currently bound fixed function
1228 * vertex program. Calling this function with a custom vertex shader
1229 * would result in an error.
1232 * model: model matrix
1235 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1236 extern void __attribute__((overloadable
1237 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1241 rsgProgramVertexLoadModelMatrix(const rs_matrix4x4* model);
1246 * rsgProgramVertexLoadProjectionMatrix: Load the projection matrix for a bound fixed function vertex program
1248 * DEPRECATED. Do not use.
1250 * Load the projection matrix for a currently bound fixed function
1251 * vertex program. Calling this function with a custom vertex shader
1252 * would result in an error.
1255 * proj: projection matrix
1258 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1259 extern void __attribute__((overloadable
1260 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1264 rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4* proj);
1269 * rsgProgramVertexLoadTextureMatrix: Load the texture matrix for a bound fixed function vertex program
1271 * DEPRECATED. Do not use.
1273 * Load the texture matrix for a currently bound fixed function
1274 * vertex program. Calling this function with a custom vertex shader
1275 * would result in an error.
1278 * tex: texture matrix
1281 #if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
1282 extern void __attribute__((overloadable
1283 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1287 rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4* tex);
1292 * rsgProgramRasterGetCullMode: Get program raster cull mode
1294 * DEPRECATED. Do not use.
1296 * Get program raster cull mode
1299 * pr: program raster to query
1302 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1303 extern rs_cull_mode __attribute__((overloadable
1304 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1308 rsgProgramRasterGetCullMode(rs_program_raster pr);
1313 * rsgProgramRasterIsPointSpriteEnabled: Get program raster point sprite state
1315 * DEPRECATED. Do not use.
1317 * Get program raster point sprite state
1320 * pr: program raster to query
1323 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1324 extern bool __attribute__((overloadable
1325 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1329 rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr);
1334 * rsgProgramStoreGetBlendDstFunc: Get program store blend destination function
1336 * DEPRECATED. Do not use.
1338 * Get program store blend destination function
1341 * ps: program store to query
1344 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1345 extern rs_blend_dst_func __attribute__((overloadable
1346 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1350 rsgProgramStoreGetBlendDstFunc(rs_program_store ps);
1355 * rsgProgramStoreGetBlendSrcFunc: Get program store blend source function
1357 * DEPRECATED. Do not use.
1359 * Get program store blend source function
1362 * ps: program store to query
1365 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1366 extern rs_blend_src_func __attribute__((overloadable
1367 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1371 rsgProgramStoreGetBlendSrcFunc(rs_program_store ps);
1376 * rsgProgramStoreGetDepthFunc: Get program store depth function
1378 * DEPRECATED. Do not use.
1380 * Get program store depth function
1383 * ps: program store to query
1386 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1387 extern rs_depth_func __attribute__((overloadable
1388 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1392 rsgProgramStoreGetDepthFunc(rs_program_store ps);
1397 * rsgProgramStoreIsColorMaskAlphaEnabled: Get program store alpha component color mask
1399 * DEPRECATED. Do not use.
1401 * Get program store alpha component color mask
1404 * ps: program store to query
1407 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1408 extern bool __attribute__((overloadable
1409 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1413 rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps);
1418 * rsgProgramStoreIsColorMaskBlueEnabled: Get program store blur component color mask
1420 * DEPRECATED. Do not use.
1422 * Get program store blur component color mask
1425 * ps: program store to query
1428 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1429 extern bool __attribute__((overloadable
1430 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1434 rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps);
1439 * rsgProgramStoreIsColorMaskGreenEnabled: Get program store green component color mask
1441 * DEPRECATED. Do not use.
1443 * Get program store green component color mask
1446 * ps: program store to query
1449 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1450 extern bool __attribute__((overloadable
1451 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1455 rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps);
1460 * rsgProgramStoreIsColorMaskRedEnabled: Get program store red component color mask
1462 * DEPRECATED. Do not use.
1464 * Get program store red component color mask
1467 * ps: program store to query
1470 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1471 extern bool __attribute__((overloadable
1472 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1476 rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps);
1481 * rsgProgramStoreIsDepthMaskEnabled: Get program store depth mask
1483 * DEPRECATED. Do not use.
1485 * Get program store depth mask
1488 * ps: program store to query
1491 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1492 extern bool __attribute__((overloadable
1493 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1497 rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps);
1502 * rsgProgramStoreIsDitherEnabled: Get program store dither state
1504 * DEPRECATED. Do not use.
1506 * Get program store dither state
1509 * ps: program store to query
1512 #if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
1513 extern bool __attribute__((overloadable
1514 #if (defined(RS_VERSION) && (RS_VERSION >= 22))
1518 rsgProgramStoreIsDitherEnabled(rs_program_store ps);
1522 #endif // RENDERSCRIPT_RS_GRAPHICS_RSH