blob: 97469d370553fb5c92915027a2d70b8a72a46cd5 [file] [log] [blame]
Jason Sams536923d2010-05-18 13:35:45 -07001/*
Alex Sakhartchouk4a36b452011-04-29 16:49:08 -07002 * Copyright (C) 2011 The Android Open Source Project
Jason Sams536923d2010-05-18 13:35:45 -07003 *
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#include "rsContext.h"
18#include "rsScriptC.h"
Jason Samsfcf72312011-04-20 15:09:01 -070019#include "rsMatrix4x4.h"
20#include "rsMatrix3x3.h"
21#include "rsMatrix2x2.h"
Jason Sams536923d2010-05-18 13:35:45 -070022
Jason Sams536923d2010-05-18 13:35:45 -070023#include "utils/Timers.h"
Alex Sakhartchouk4a36b452011-04-29 16:49:08 -070024#include "driver/rsdVertexArray.h"
25#include "driver/rsdShaderCache.h"
26#include "driver/rsdCore.h"
Jason Sams536923d2010-05-18 13:35:45 -070027
28#define GL_GLEXT_PROTOTYPES
29
30#include <GLES/gl.h>
31#include <GLES/glext.h>
32#include <GLES2/gl2.h>
33#include <GLES2/gl2ext.h>
34
35#include <time.h>
36
37using namespace android;
38using namespace android::renderscript;
39
Jason Samsfcf72312011-04-20 15:09:01 -070040namespace android {
41namespace renderscript {
Jason Sams536923d2010-05-18 13:35:45 -070042
43//////////////////////////////////////////////////////////////////////////////
Jason Sams536923d2010-05-18 13:35:45 -070044// Context
45//////////////////////////////////////////////////////////////////////////////
46
Jason Samsfcf72312011-04-20 15:09:01 -070047void rsrBindTexture(Context *rsc, Script *sc, ProgramFragment *pf, uint32_t slot, Allocation *a) {
48 CHECK_OBJ_OR_NULL(a);
49 CHECK_OBJ(pf);
50 pf->bindTexture(rsc, slot, a);
Jason Sams536923d2010-05-18 13:35:45 -070051}
52
Alex Sakhartchouk33680ff2012-01-10 10:16:52 -080053void rsrBindConstant(Context *rsc, Script *sc, ProgramFragment *pf, uint32_t slot, Allocation *a) {
54 CHECK_OBJ_OR_NULL(a);
55 CHECK_OBJ(pf);
56 pf->bindAllocation(rsc, a, slot);
57}
58
Alex Sakhartchoukfdccec92012-01-10 14:30:34 -080059void rsrBindConstant(Context *rsc, Script *sc, ProgramVertex *pv, uint32_t slot, Allocation *a) {
Alex Sakhartchouk33680ff2012-01-10 10:16:52 -080060 CHECK_OBJ_OR_NULL(a);
Alex Sakhartchoukfdccec92012-01-10 14:30:34 -080061 CHECK_OBJ(pv);
62 pv->bindAllocation(rsc, a, slot);
Alex Sakhartchouk33680ff2012-01-10 10:16:52 -080063}
64
Jason Samsfcf72312011-04-20 15:09:01 -070065void rsrBindSampler(Context *rsc, Script *sc, ProgramFragment *pf, uint32_t slot, Sampler *s) {
Jason Samsf166d9b2010-09-30 18:15:52 -070066 CHECK_OBJ_OR_NULL(vs);
67 CHECK_OBJ(vpf);
Jason Samsfcf72312011-04-20 15:09:01 -070068 pf->bindSampler(rsc, slot, s);
Jason Sams536923d2010-05-18 13:35:45 -070069}
70
Jason Samsfcf72312011-04-20 15:09:01 -070071void rsrBindProgramStore(Context *rsc, Script *sc, ProgramStore *ps) {
72 CHECK_OBJ_OR_NULL(ps);
73 rsc->setProgramStore(ps);
Jason Sams536923d2010-05-18 13:35:45 -070074}
75
Jason Samsfcf72312011-04-20 15:09:01 -070076void rsrBindProgramFragment(Context *rsc, Script *sc, ProgramFragment *pf) {
Jason Samsf166d9b2010-09-30 18:15:52 -070077 CHECK_OBJ_OR_NULL(pf);
Jason Samsfcf72312011-04-20 15:09:01 -070078 rsc->setProgramFragment(pf);
Jason Sams536923d2010-05-18 13:35:45 -070079}
80
Jason Samsfcf72312011-04-20 15:09:01 -070081void rsrBindProgramVertex(Context *rsc, Script *sc, ProgramVertex *pv) {
Jason Samsf166d9b2010-09-30 18:15:52 -070082 CHECK_OBJ_OR_NULL(pv);
Jason Samsfcf72312011-04-20 15:09:01 -070083 rsc->setProgramVertex(pv);
Jason Sams536923d2010-05-18 13:35:45 -070084}
85
Jason Samsfcf72312011-04-20 15:09:01 -070086void rsrBindProgramRaster(Context *rsc, Script *sc, ProgramRaster *pr) {
87 CHECK_OBJ_OR_NULL(pr);
88 rsc->setProgramRaster(pr);
Jason Sams536923d2010-05-18 13:35:45 -070089}
90
Jason Samsfcf72312011-04-20 15:09:01 -070091void rsrBindFrameBufferObjectColorTarget(Context *rsc, Script *sc, Allocation *a, uint32_t slot) {
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -070092 CHECK_OBJ(va);
Jason Samsfcf72312011-04-20 15:09:01 -070093 rsc->mFBOCache.bindColorTarget(rsc, a, slot);
Alex Sakhartchouk2d8ef492011-11-16 12:22:10 -080094 rsc->mStateVertex.updateSize(rsc);
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -070095}
96
Jason Samsfcf72312011-04-20 15:09:01 -070097void rsrBindFrameBufferObjectDepthTarget(Context *rsc, Script *sc, Allocation *a) {
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -070098 CHECK_OBJ(va);
Jason Samsfcf72312011-04-20 15:09:01 -070099 rsc->mFBOCache.bindDepthTarget(rsc, a);
Alex Sakhartchouk2d8ef492011-11-16 12:22:10 -0800100 rsc->mStateVertex.updateSize(rsc);
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700101}
102
Jason Samsfcf72312011-04-20 15:09:01 -0700103void rsrClearFrameBufferObjectColorTarget(Context *rsc, Script *sc, uint32_t slot) {
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700104 rsc->mFBOCache.bindColorTarget(rsc, NULL, slot);
Alex Sakhartchouk2d8ef492011-11-16 12:22:10 -0800105 rsc->mStateVertex.updateSize(rsc);
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700106}
107
Jason Samsfcf72312011-04-20 15:09:01 -0700108void rsrClearFrameBufferObjectDepthTarget(Context *rsc, Script *sc) {
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700109 rsc->mFBOCache.bindDepthTarget(rsc, NULL);
Alex Sakhartchouk2d8ef492011-11-16 12:22:10 -0800110 rsc->mStateVertex.updateSize(rsc);
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700111}
112
Jason Samsfcf72312011-04-20 15:09:01 -0700113void rsrClearFrameBufferObjectTargets(Context *rsc, Script *sc) {
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700114 rsc->mFBOCache.resetAll(rsc);
Alex Sakhartchouk2d8ef492011-11-16 12:22:10 -0800115 rsc->mStateVertex.updateSize(rsc);
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700116}
117
Jason Sams536923d2010-05-18 13:35:45 -0700118//////////////////////////////////////////////////////////////////////////////
119// VP
120//////////////////////////////////////////////////////////////////////////////
121
Jason Samsfcf72312011-04-20 15:09:01 -0700122void rsrVpLoadProjectionMatrix(Context *rsc, Script *sc, const rsc_Matrix *m) {
Jason Samsa17af042010-11-17 15:29:32 -0800123 rsc->getProgramVertex()->setProjectionMatrix(rsc, m);
Jim Millerd8e76202010-07-28 14:46:22 -0700124}
125
Jason Samsfcf72312011-04-20 15:09:01 -0700126void rsrVpLoadModelMatrix(Context *rsc, Script *sc, const rsc_Matrix *m) {
Jason Samsa17af042010-11-17 15:29:32 -0800127 rsc->getProgramVertex()->setModelviewMatrix(rsc, m);
Jason Sams536923d2010-05-18 13:35:45 -0700128}
129
Jason Samsfcf72312011-04-20 15:09:01 -0700130void rsrVpLoadTextureMatrix(Context *rsc, Script *sc, const rsc_Matrix *m) {
Jason Samsa17af042010-11-17 15:29:32 -0800131 rsc->getProgramVertex()->setTextureMatrix(rsc, m);
Jason Sams536923d2010-05-18 13:35:45 -0700132}
133
Jason Samsfcf72312011-04-20 15:09:01 -0700134void rsrPfConstantColor(Context *rsc, Script *sc, ProgramFragment *pf,
135 float r, float g, float b, float a) {
136 CHECK_OBJ(pf);
Alex Sakhartchoukb89aaac2010-09-23 16:16:33 -0700137 pf->setConstantColor(rsc, r, g, b, a);
Jason Sams442a6472010-08-04 17:50:20 -0700138}
139
Jason Samsfcf72312011-04-20 15:09:01 -0700140void rsrVpGetProjectionMatrix(Context *rsc, Script *sc, rsc_Matrix *m) {
Jason Samsa17af042010-11-17 15:29:32 -0800141 rsc->getProgramVertex()->getProjectionMatrix(rsc, m);
Alex Sakhartchoukcbed7522010-08-16 17:40:10 -0700142}
143
Jason Sams536923d2010-05-18 13:35:45 -0700144//////////////////////////////////////////////////////////////////////////////
145// Drawing
146//////////////////////////////////////////////////////////////////////////////
147
Jason Samsfcf72312011-04-20 15:09:01 -0700148void rsrDrawQuadTexCoords(Context *rsc, Script *sc,
149 float x1, float y1, float z1, float u1, float v1,
150 float x2, float y2, float z2, float u2, float v2,
151 float x3, float y3, float z3, float u3, float v3,
152 float x4, float y4, float z4, float u4, float v4) {
Jason Sams536923d2010-05-18 13:35:45 -0700153 if (!rsc->setupCheck()) {
154 return;
155 }
156
Alex Sakhartchouk4a36b452011-04-29 16:49:08 -0700157 RsdHal *dc = (RsdHal *)rsc->mHal.drv;
158 if (!dc->gl.shaderCache->setup(rsc)) {
159 return;
160 }
161
Steve Block3762c312012-01-06 19:20:56 +0000162 //ALOGE("Quad");
163 //ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1);
164 //ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2);
165 //ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3);
166 //ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4);
Jason Sams536923d2010-05-18 13:35:45 -0700167
168 float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4};
169 const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4};
170
Alex Sakhartchouk4a36b452011-04-29 16:49:08 -0700171 RsdVertexArray::Attrib attribs[2];
Alex Sakhartchouk9d71e212010-11-08 15:10:52 -0800172 attribs[0].set(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "ATTRIB_position");
173 attribs[1].set(GL_FLOAT, 2, 8, false, (uint32_t)tex, "ATTRIB_texture0");
174
Alex Sakhartchouk4a36b452011-04-29 16:49:08 -0700175 RsdVertexArray va(attribs, 2);
Alex Sakhartchouk407cae92011-05-06 14:59:45 -0700176 va.setup(rsc);
Jason Sams536923d2010-05-18 13:35:45 -0700177
Jason Sams5316b9e2011-09-13 15:41:01 -0700178 RSD_CALL_GL(glDrawArrays, GL_TRIANGLE_FAN, 0, 4);
Jason Sams536923d2010-05-18 13:35:45 -0700179}
180
Jason Samsfcf72312011-04-20 15:09:01 -0700181void rsrDrawQuad(Context *rsc, Script *sc,
182 float x1, float y1, float z1,
183 float x2, float y2, float z2,
184 float x3, float y3, float z3,
185 float x4, float y4, float z4) {
186 rsrDrawQuadTexCoords(rsc, sc, x1, y1, z1, 0, 1,
187 x2, y2, z2, 1, 1,
188 x3, y3, z3, 1, 0,
189 x4, y4, z4, 0, 0);
Jason Sams536923d2010-05-18 13:35:45 -0700190}
191
Jason Samsfcf72312011-04-20 15:09:01 -0700192void rsrDrawSpriteScreenspace(Context *rsc, Script *sc,
193 float x, float y, float z, float w, float h) {
Jason Samsa17af042010-11-17 15:29:32 -0800194 ObjectBaseRef<const ProgramVertex> tmp(rsc->getProgramVertex());
195 rsc->setProgramVertex(rsc->getDefaultProgramVertex());
Jason Sams536923d2010-05-18 13:35:45 -0700196 //rsc->setupCheck();
197
198 //GLint crop[4] = {0, h, w, -h};
199
200 float sh = rsc->getHeight();
201
Jason Samsfcf72312011-04-20 15:09:01 -0700202 rsrDrawQuad(rsc, sc,
203 x, sh - y, z,
Jason Sams536923d2010-05-18 13:35:45 -0700204 x+w, sh - y, z,
205 x+w, sh - (y+h), z,
206 x, sh - (y+h), z);
Jason Samsa17af042010-11-17 15:29:32 -0800207 rsc->setProgramVertex((ProgramVertex *)tmp.get());
Jason Sams536923d2010-05-18 13:35:45 -0700208}
Jason Sams536923d2010-05-18 13:35:45 -0700209
Jason Samsfcf72312011-04-20 15:09:01 -0700210void rsrDrawRect(Context *rsc, Script *sc, float x1, float y1, float x2, float y2, float z) {
Steve Block3762c312012-01-06 19:20:56 +0000211 //ALOGE("SC_drawRect %f,%f %f,%f %f", x1, y1, x2, y2, z);
Jason Samsfcf72312011-04-20 15:09:01 -0700212 rsrDrawQuad(rsc, sc, x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z);
Jason Sams536923d2010-05-18 13:35:45 -0700213}
214
Jason Samsf15ed012011-10-31 13:23:43 -0700215void rsrDrawPath(Context *rsc, Script *sc, Path *sm) {
216 CHECK_OBJ(sm);
217 if (!rsc->setupCheck()) {
218 return;
219 }
220 sm->render(rsc);
221}
222
Jason Samsfcf72312011-04-20 15:09:01 -0700223void rsrDrawMesh(Context *rsc, Script *sc, Mesh *sm) {
224 CHECK_OBJ(sm);
Jason Sams536923d2010-05-18 13:35:45 -0700225 if (!rsc->setupCheck()) {
226 return;
227 }
228 sm->render(rsc);
229}
230
Jason Samsfcf72312011-04-20 15:09:01 -0700231void rsrDrawMeshPrimitive(Context *rsc, Script *sc, Mesh *sm, uint32_t primIndex) {
232 CHECK_OBJ(sm);
Jason Sams536923d2010-05-18 13:35:45 -0700233 if (!rsc->setupCheck()) {
234 return;
235 }
Alex Sakhartchouk164aaed2010-07-01 16:14:06 -0700236 sm->renderPrimitive(rsc, primIndex);
237}
238
Jason Samsfcf72312011-04-20 15:09:01 -0700239void rsrDrawMeshPrimitiveRange(Context *rsc, Script *sc, Mesh *sm, uint32_t primIndex,
240 uint32_t start, uint32_t len) {
241 CHECK_OBJ(sm);
Alex Sakhartchouk164aaed2010-07-01 16:14:06 -0700242 if (!rsc->setupCheck()) {
243 return;
244 }
245 sm->renderPrimitiveRange(rsc, primIndex, start, len);
Jason Sams536923d2010-05-18 13:35:45 -0700246}
247
Jason Samsfcf72312011-04-20 15:09:01 -0700248void rsrMeshComputeBoundingBox(Context *rsc, Script *sc, Mesh *sm,
249 float *minX, float *minY, float *minZ,
250 float *maxX, float *maxY, float *maxZ) {
251 CHECK_OBJ(sm);
Alex Sakhartchouka80145d2010-08-13 14:32:23 -0700252 sm->computeBBox();
253 *minX = sm->mBBoxMin[0];
254 *minY = sm->mBBoxMin[1];
255 *minZ = sm->mBBoxMin[2];
256 *maxX = sm->mBBoxMax[0];
257 *maxY = sm->mBBoxMax[1];
258 *maxZ = sm->mBBoxMax[2];
259}
260
Jason Sams536923d2010-05-18 13:35:45 -0700261
262//////////////////////////////////////////////////////////////////////////////
263//
264//////////////////////////////////////////////////////////////////////////////
265
266
Jason Samsfcf72312011-04-20 15:09:01 -0700267void rsrColor(Context *rsc, Script *sc, float r, float g, float b, float a) {
268 ProgramFragment *pf = rsc->getProgramFragment();
Alex Sakhartchoukb89aaac2010-09-23 16:16:33 -0700269 pf->setConstantColor(rsc, r, g, b, a);
Jason Sams536923d2010-05-18 13:35:45 -0700270}
271
Jason Samsfcf72312011-04-20 15:09:01 -0700272void rsrFinish(Context *rsc, Script *sc) {
Jason Sams5316b9e2011-09-13 15:41:01 -0700273 RSD_CALL_GL(glFinish);
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700274}
275
Jason Sams6d8eb262010-12-15 01:41:00 -0800276
Jason Samsfcf72312011-04-20 15:09:01 -0700277void rsrClearColor(Context *rsc, Script *sc, float r, float g, float b, float a) {
Alex Sakhartchouk407cae92011-05-06 14:59:45 -0700278 rsc->mFBOCache.setup(rsc);
Alex Sakhartchoukfeede2a2010-10-01 10:54:06 -0700279 rsc->setupProgramStore();
Jason Samsd79b2e92010-05-19 17:22:57 -0700280
Jason Sams5316b9e2011-09-13 15:41:01 -0700281 RSD_CALL_GL(glClearColor, r, g, b, a);
282 RSD_CALL_GL(glClear, GL_COLOR_BUFFER_BIT);
Jason Samsd79b2e92010-05-19 17:22:57 -0700283}
284
Jason Samsfcf72312011-04-20 15:09:01 -0700285void rsrClearDepth(Context *rsc, Script *sc, float v) {
Alex Sakhartchouk407cae92011-05-06 14:59:45 -0700286 rsc->mFBOCache.setup(rsc);
Alex Sakhartchoukfeede2a2010-10-01 10:54:06 -0700287 rsc->setupProgramStore();
Jason Samsd79b2e92010-05-19 17:22:57 -0700288
Jason Sams5316b9e2011-09-13 15:41:01 -0700289 RSD_CALL_GL(glClearDepthf, v);
290 RSD_CALL_GL(glClear, GL_DEPTH_BUFFER_BIT);
Jason Sams536923d2010-05-18 13:35:45 -0700291}
292
Jason Samsfcf72312011-04-20 15:09:01 -0700293uint32_t rsrGetWidth(Context *rsc, Script *sc) {
Jason Sams536923d2010-05-18 13:35:45 -0700294 return rsc->getWidth();
295}
296
Jason Samsfcf72312011-04-20 15:09:01 -0700297uint32_t rsrGetHeight(Context *rsc, Script *sc) {
Jason Sams536923d2010-05-18 13:35:45 -0700298 return rsc->getHeight();
299}
300
Jason Samsfcf72312011-04-20 15:09:01 -0700301void rsrDrawTextAlloc(Context *rsc, Script *sc, Allocation *a, int x, int y) {
302 const char *text = (const char *)a->getPtr();
303 size_t allocSize = a->getType()->getSizeBytes();
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700304 rsc->mStateFont.renderText(text, allocSize, x, y);
Alex Sakhartchouk9b949fc2010-06-24 17:15:34 -0700305}
306
Jason Samsfcf72312011-04-20 15:09:01 -0700307void rsrDrawText(Context *rsc, Script *sc, const char *text, int x, int y) {
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700308 size_t textLen = strlen(text);
309 rsc->mStateFont.renderText(text, textLen, x, y);
310}
311
Jason Samsfcf72312011-04-20 15:09:01 -0700312static void SetMetrics(Font::Rect *metrics,
313 int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
Alex Sakhartchouked9f2102010-11-09 17:00:54 -0800314 if (left) {
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700315 *left = metrics->left;
316 }
Alex Sakhartchouked9f2102010-11-09 17:00:54 -0800317 if (right) {
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700318 *right = metrics->right;
319 }
Alex Sakhartchouked9f2102010-11-09 17:00:54 -0800320 if (top) {
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700321 *top = metrics->top;
322 }
Alex Sakhartchouked9f2102010-11-09 17:00:54 -0800323 if (bottom) {
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700324 *bottom = metrics->bottom;
325 }
326}
327
Jason Samsfcf72312011-04-20 15:09:01 -0700328void rsrMeasureTextAlloc(Context *rsc, Script *sc, Allocation *a,
329 int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
330 CHECK_OBJ(a);
331 const char *text = (const char *)a->getPtr();
332 size_t textLen = a->getType()->getSizeBytes();
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700333 Font::Rect metrics;
334 rsc->mStateFont.measureText(text, textLen, &metrics);
Jason Samsfcf72312011-04-20 15:09:01 -0700335 SetMetrics(&metrics, left, right, top, bottom);
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700336}
337
Jason Samsfcf72312011-04-20 15:09:01 -0700338void rsrMeasureText(Context *rsc, Script *sc, const char *text,
339 int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
Alex Sakhartchouk10825a02010-10-05 11:33:27 -0700340 size_t textLen = strlen(text);
341 Font::Rect metrics;
342 rsc->mStateFont.measureText(text, textLen, &metrics);
Jason Samsfcf72312011-04-20 15:09:01 -0700343 SetMetrics(&metrics, left, right, top, bottom);
Alex Sakhartchouk9b949fc2010-06-24 17:15:34 -0700344}
345
Jason Samsfcf72312011-04-20 15:09:01 -0700346void rsrBindFont(Context *rsc, Script *sc, Font *font) {
Jason Samsf166d9b2010-09-30 18:15:52 -0700347 CHECK_OBJ(font);
Alex Sakhartchouk9b949fc2010-06-24 17:15:34 -0700348 rsi_ContextBindFont(rsc, font);
349}
Jason Sams536923d2010-05-18 13:35:45 -0700350
Jason Samsfcf72312011-04-20 15:09:01 -0700351void rsrFontColor(Context *rsc, Script *sc, float r, float g, float b, float a) {
Alex Sakhartchoukfb10c162010-08-04 14:45:48 -0700352 rsc->mStateFont.setFontColor(r, g, b, a);
353}
354
Jason Sams536923d2010-05-18 13:35:45 -0700355}
Jason Samsfcf72312011-04-20 15:09:01 -0700356}