diff options
author | Jason Sams <rjsams@android.com> | 2010-03-03 13:03:18 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-03-03 14:14:37 -0800 |
commit | 156cce698093023d9e79a4ff4fb96f4e4d3019db (patch) | |
tree | ff5ce34e453d2f475bcab35d29f5a7d00d53554d /libs/rs/rsScriptC_Lib.cpp | |
parent | a034cd3e15b6626be03e60f2d6a0f929dcb950d9 (diff) | |
download | frameworks_base-156cce698093023d9e79a4ff4fb96f4e4d3019db.zip frameworks_base-156cce698093023d9e79a4ff4fb96f4e4d3019db.tar.gz frameworks_base-156cce698093023d9e79a4ff4fb96f4e4d3019db.tar.bz2 |
Improve RS error handling. On errors RS will now store the error and a message that can be read from the app. RS will then not continue rendering frames while an unchecked error is present until new state is received.
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index 235c153..202ca3d 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -683,7 +683,9 @@ static void SC_drawLine(float x1, float y1, float z1, float x2, float y2, float z2) { GET_TLS(); - rsc->setupCheck(); + if (!rsc->setupCheck()) { + return; + } float vtx[] = { x1, y1, z1, x2, y2, z2 }; VertexArray va; @@ -700,7 +702,9 @@ static void SC_drawLine(float x1, float y1, float z1, static void SC_drawPoint(float x, float y, float z) { GET_TLS(); - rsc->setupCheck(); + if (!rsc->setupCheck()) { + return; + } float vtx[] = { x, y, z }; @@ -725,7 +729,9 @@ static void SC_drawQuadTexCoords(float x1, float y1, float z1, float u4, float v4) { GET_TLS(); - rsc->setupCheck(); + if (!rsc->setupCheck()) { + return; + } //LOGE("Quad"); //LOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1); @@ -782,7 +788,9 @@ static void SC_drawSpriteScreenspaceCropped(float x, float y, float z, float w, float cx0, float cy0, float cx1, float cy1) { GET_TLS(); - rsc->setupCheck(); + if (!rsc->setupCheck()) { + return; + } GLint crop[4] = {cx0, cy0, cx1, cy1}; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop); @@ -831,7 +839,9 @@ static void SC_drawSimpleMesh(RsSimpleMesh vsm) { GET_TLS(); SimpleMesh *sm = static_cast<SimpleMesh *>(vsm); - rsc->setupCheck(); + if (!rsc->setupCheck()) { + return; + } sm->render(rsc); } @@ -839,7 +849,9 @@ static void SC_drawSimpleMeshRange(RsSimpleMesh vsm, uint32_t start, uint32_t le { GET_TLS(); SimpleMesh *sm = static_cast<SimpleMesh *>(vsm); - rsc->setupCheck(); + if (!rsc->setupCheck()) { + return; + } sm->renderRange(rsc, start, len); } |