diff options
| author | Jason Sams <rjsams@android.com> | 2010-08-04 17:50:20 -0700 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2010-08-05 10:00:21 -0700 |
| commit | 6445e5210c6d7f8689e94be9026153d017c9545b (patch) | |
| tree | 2a721d2e71810c4ec3ab627f7bbf312a20b381d2 /rsScriptC_LibGL.cpp | |
| parent | 9fc9f0375a92fe22fecb3782b18a5c6060a07290 (diff) | |
| download | android_frameworks_rs-6445e5210c6d7f8689e94be9026153d017c9545b.tar.gz android_frameworks_rs-6445e5210c6d7f8689e94be9026153d017c9545b.tar.bz2 android_frameworks_rs-6445e5210c6d7f8689e94be9026153d017c9545b.zip | |
Support constant and varying colors in ProgramFragment.
Change-Id: I16ce84ff427016f3a1923594efc718eca32dd7f2
Diffstat (limited to 'rsScriptC_LibGL.cpp')
| -rw-r--r-- | rsScriptC_LibGL.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/rsScriptC_LibGL.cpp b/rsScriptC_LibGL.cpp index 22b0945b..f5e59534 100644 --- a/rsScriptC_LibGL.cpp +++ b/rsScriptC_LibGL.cpp @@ -110,6 +110,13 @@ static void SC_vpLoadTextureMatrix(const rsc_Matrix *m) } +static void SC_pfConstantColor(RsProgramFragment vpf, float r, float g, float b, float a) +{ + //GET_TLS(); + ProgramFragment *pf = static_cast<ProgramFragment *>(vpf); + pf->setConstantColor(r, g, b, a); +} + ////////////////////////////////////////////////////////////////////////////// // Drawing @@ -253,13 +260,8 @@ static void SC_drawMeshPrimitiveRange(RsMesh vsm, uint32_t primIndex, uint32_t s static void SC_color(float r, float g, float b, float a) { GET_TLS(); - rsc->mStateVertex.color[0] = r; - rsc->mStateVertex.color[1] = g; - rsc->mStateVertex.color[2] = b; - rsc->mStateVertex.color[3] = a; - if (!rsc->checkVersion2_0()) { - glColor4f(r, g, b, a); - } + ProgramFragment *pf = (ProgramFragment *)rsc->getFragment(); + pf->setConstantColor(r, g, b, a); } static void SC_uploadToTexture2(RsAllocation va, uint32_t baseMipLevel) @@ -371,6 +373,8 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadModelMatrix }, { "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadTextureMatrix }, + { "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_pfConstantColor }, + { "_Z11rsgGetWidthv", (void *)&SC_getWidth }, { "_Z12rsgGetHeightv", (void *)&SC_getHeight }, |
