rs_graphics.spec revision c5184e202ced435258adb2cfe2013570e7190954
1# 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: 20 A set of graphics functions used by RenderScript. 21include: 22 #ifdef __LP64__ 23 // TODO We need to fix some of the builds before enabling this error: 24 // #error "RenderScript graphics is deprecated and not supported in 64bit mode." 25 #else 26 #include "rs_mesh.rsh" 27 #include "rs_program.rsh" 28 #endif 29end: 30 31function: rsgAllocationSyncAll 32size: 32 33ret: void 34arg: rs_allocation alloc 35summary: 36description: 37 Sync the contents of an allocation. 38 39 If the source is specified, sync from memory space specified by source. 40 41 If the source is not specified, sync from its SCRIPT memory space to its HW 42 memory spaces. 43test: none 44end: 45 46function: rsgAllocationSyncAll 47version: 14 48size: 32 49ret: void 50arg: rs_allocation alloc 51arg: rs_allocation_usage_type source 52test: none 53end: 54 55function: rsgBindColorTarget 56version: 14 57size: 32 58ret: void 59arg: rs_allocation colorTarget 60arg: uint slot 61summary: 62description: 63 Set the color target used for all subsequent rendering calls 64test: none 65end: 66 67function: rsgBindConstant 68size: 32 69ret: void 70arg: rs_program_fragment ps, "program fragment object" 71arg: uint slot, "index of the constant buffer on the program" 72arg: rs_allocation c, "constants to bind" 73summary: 74description: 75 Bind a new Allocation object to a ProgramFragment or ProgramVertex. 76 The Allocation must be a valid constant input for the Program. 77test: none 78end: 79 80function: rsgBindConstant 81size: 32 82ret: void 83arg: rs_program_vertex pv, "program vertex object" 84arg: uint slot 85arg: rs_allocation c 86test: none 87end: 88 89function: rsgBindDepthTarget 90version: 14 91size: 32 92ret: void 93arg: rs_allocation depthTarget 94summary: 95description: 96 Set the depth target used for all subsequent rendering calls 97test: none 98end: 99 100function: rsgBindFont 101size: 32 102ret: void 103arg: rs_font font, "object to bind" 104summary: 105description: 106 Binds the font object to be used for all subsequent font rendering calls 107test: none 108end: 109 110function: rsgBindProgramFragment 111size: 32 112ret: void 113arg: rs_program_fragment pf 114summary: 115description: 116 Bind a new ProgramFragment to the rendering context. 117test: none 118end: 119 120function: rsgBindProgramRaster 121size: 32 122ret: void 123arg: rs_program_raster pr 124summary: 125description: 126 Bind a new ProgramRaster to the rendering context. 127test: none 128end: 129 130function: rsgBindProgramStore 131size: 32 132ret: void 133arg: rs_program_store ps 134summary: 135description: 136 Bind a new ProgramStore to the rendering context. 137test: none 138end: 139 140function: rsgBindProgramVertex 141size: 32 142ret: void 143arg: rs_program_vertex pv 144summary: 145description: 146 Bind a new ProgramVertex to the rendering context. 147test: none 148end: 149 150function: rsgBindSampler 151size: 32 152ret: void 153arg: rs_program_fragment fragment 154arg: uint slot 155arg: rs_sampler sampler 156summary: 157description: 158 Bind a new Sampler object to a ProgramFragment. The sampler will 159 operate on the texture bound at the matching slot. 160test: none 161end: 162 163function: rsgBindTexture 164size: 32 165ret: void 166arg: rs_program_fragment v 167arg: uint slot 168arg: rs_allocation alloc 169summary: 170description: 171 Bind a new Allocation object to a ProgramFragment. The 172 Allocation must be a valid texture for the Program. The sampling 173 of the texture will be controled by the Sampler bound at the 174 matching slot. 175test: none 176end: 177 178function: rsgClearAllRenderTargets 179version: 14 180size: 32 181ret: void 182summary: 183description: 184 Clear all color and depth targets and resume rendering into 185 the framebuffer 186test: none 187end: 188 189function: rsgClearColor 190size: 32 191ret: void 192arg: float r 193arg: float g 194arg: float b 195arg: float a 196summary: 197description: 198 Clears the rendering surface to the specified color. 199test: none 200end: 201 202function: rsgClearColorTarget 203version: 14 204size: 32 205ret: void 206arg: uint slot 207summary: 208description: 209 Clear the previously set color target 210test: none 211end: 212 213function: rsgClearDepth 214size: 32 215ret: void 216arg: float value 217summary: 218description: 219 Clears the depth suface to the specified value. 220test: none 221end: 222 223function: rsgClearDepthTarget 224version: 14 225size: 32 226ret: void 227summary: 228description: 229 Clear the previously set depth target 230test: none 231end: 232 233function: rsgDrawMesh 234size: 32 235ret: void 236arg: rs_mesh ism, "mesh object to render" 237summary: 238description: 239 Draw a mesh using the current context state. 240 241 If primitiveIndex is specified, draw part of a mesh using the current context state. 242 243 If start and len are also specified, draw specified index range of part of a mesh using the current context state. 244 245 Otherwise the whole mesh is rendered. 246test: none 247end: 248 249function: rsgDrawMesh 250size: 32 251ret: void 252arg: rs_mesh ism 253arg: uint primitiveIndex, "for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw." 254test: none 255end: 256 257function: rsgDrawMesh 258size: 32 259ret: void 260arg: rs_mesh ism 261arg: uint primitiveIndex 262arg: uint start, "starting index in the range" 263arg: uint len, "number of indices to draw" 264test: none 265end: 266 267function: rsgDrawQuad 268size: 32 269ret: void 270arg: float x1 271arg: float y1 272arg: float z1 273arg: float x2 274arg: float y2 275arg: float z2 276arg: float x3 277arg: float y3 278arg: float z3 279arg: float x4 280arg: float y4 281arg: float z4 282summary: 283description: 284 Low performance utility function for drawing a simple quad. Not intended for 285 drawing large quantities of geometry. 286test: none 287end: 288 289function: rsgDrawQuadTexCoords 290size: 32 291ret: void 292arg: float x1 293arg: float y1 294arg: float z1 295arg: float u1 296arg: float v1 297arg: float x2 298arg: float y2 299arg: float z2 300arg: float u2 301arg: float v2 302arg: float x3 303arg: float y3 304arg: float z3 305arg: float u3 306arg: float v3 307arg: float x4 308arg: float y4 309arg: float z4 310arg: float u4 311arg: float v4 312summary: 313description: 314 Low performance utility function for drawing a textured quad. Not intended 315 for drawing large quantities of geometry. 316test: none 317end: 318 319function: rsgDrawRect 320size: 32 321ret: void 322arg: float x1 323arg: float y1 324arg: float x2 325arg: float y2 326arg: float z 327summary: 328description: 329 Low performance utility function for drawing a simple rectangle. Not 330 intended for drawing large quantities of geometry. 331test: none 332end: 333 334function: rsgDrawSpriteScreenspace 335size: 32 336ret: void 337arg: float x 338arg: float y 339arg: float z 340arg: float w 341arg: float h 342summary: 343description: 344 Low performance function for drawing rectangles in screenspace. This 345 function uses the default passthough ProgramVertex. Any bound ProgramVertex 346 is ignored. This function has considerable overhead and should not be used 347 for drawing in shipping applications. 348test: none 349end: 350 351function: rsgDrawText 352size: 32 353ret: void 354arg: const char* text 355arg: int x 356arg: int y 357summary: 358description: 359 Draws text given a string and location 360test: none 361end: 362 363function: rsgDrawText 364size: 32 365ret: void 366arg: rs_allocation alloc 367arg: int x 368arg: int y 369test: none 370end: 371 372function: rsgFinish 373version: 14 374size: 32 375ret: uint 376summary: 377description: 378 Force RenderScript to finish all rendering commands 379test: none 380end: 381 382function: rsgFontColor 383size: 32 384ret: void 385arg: float r, "red component" 386arg: float g, "green component" 387arg: float b, "blue component" 388arg: float a, "alpha component" 389summary: 390description: 391 Sets the font color for all subsequent rendering calls 392test: none 393end: 394 395function: rsgGetHeight 396size: 32 397ret: uint 398summary: 399description: 400 Get the height of the current rendering surface. 401test: none 402end: 403 404function: rsgGetWidth 405size: 32 406ret: uint 407summary: 408description: 409 Get the width of the current rendering surface. 410test: none 411end: 412 413function: rsgMeasureText 414size: 32 415ret: void 416arg: const char* text 417arg: int* left 418arg: int* right 419arg: int* top 420arg: int* bottom 421summary: 422description: 423 Returns the bounding box of the text relative to (0, 0) 424 Any of left, right, top, bottom could be NULL 425test: none 426end: 427 428function: rsgMeasureText 429size: 32 430ret: void 431arg: rs_allocation alloc 432arg: int* left 433arg: int* right 434arg: int* top 435arg: int* bottom 436test: none 437end: 438 439function: rsgMeshComputeBoundingBox 440size: 32 441ret: void 442arg: rs_mesh mesh 443arg: float* minX 444arg: float* minY 445arg: float* min 446arg: float* maxX 447arg: float* maxY 448arg: float* maxZ 449summary: 450description: 451 Computes an axis aligned bounding box of a mesh object 452test: none 453end: 454 455function: rsgMeshComputeBoundingBox 456size: 32 457attrib: always_inline 458ret: void 459arg: rs_mesh mesh 460arg: float3* bBoxMin 461arg: float3* bBoxMax 462inline: 463 float x1, y1, z1, x2, y2, z2; 464 rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2); 465 bBoxMin->x = x1; 466 bBoxMin->y = y1; 467 bBoxMin->z = z1; 468 bBoxMax->x = x2; 469 bBoxMax->y = y2; 470 bBoxMax->z = z2; 471test: none 472end: 473 474 475function: rsgProgramFragmentConstantColor 476size: 32 477ret: void 478arg: rs_program_fragment pf 479arg: float r 480arg: float g 481arg: float b 482arg: float a 483summary: 484description: 485 Set the constant color for a fixed function emulation program. 486test: none 487end: 488 489function: rsgProgramVertexGetProjectionMatrix 490size: 32 491ret: void 492arg: rs_matrix4x4* proj, "matrix to store the current projection matrix into" 493summary: 494description: 495 Get the projection matrix for a currently bound fixed function 496 vertex program. Calling this function with a custom vertex shader 497 would result in an error. 498test: none 499end: 500 501function: rsgProgramVertexLoadModelMatrix 502size: 32 503ret: void 504arg: const rs_matrix4x4* model, "model matrix" 505summary: 506description: 507 Load the model matrix for a currently bound fixed function 508 vertex program. Calling this function with a custom vertex shader 509 would result in an error. 510test: none 511end: 512 513function: rsgProgramVertexLoadProjectionMatrix 514size: 32 515ret: void 516arg: const rs_matrix4x4* proj, "projection matrix" 517summary: 518description: 519 Load the projection matrix for a currently bound fixed function 520 vertex program. Calling this function with a custom vertex shader 521 would result in an error. 522test: none 523end: 524 525function: rsgProgramVertexLoadTextureMatrix 526size: 32 527ret: void 528arg: const rs_matrix4x4* tex, "texture matrix" 529summary: 530description: 531 Load the texture matrix for a currently bound fixed function 532 vertex program. Calling this function with a custom vertex shader 533 would result in an error. 534test: none 535end: 536 537#endif //__LP64__ 538