Merge "Add some error checking." into honeycomb
This commit is contained in:
@@ -212,6 +212,7 @@ void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff,
|
||||
GLenum type = mType->getElement()->getComponent().getGLType();
|
||||
GLenum format = mType->getElement()->getComponent().getGLFormat();
|
||||
GLenum target = (GLenum)getGLTarget();
|
||||
rsAssert(mTextureID);
|
||||
glBindTexture(target, mTextureID);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLenum t = GL_TEXTURE_2D;
|
||||
|
||||
@@ -53,6 +53,10 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand) {
|
||||
waitForCommand = false;
|
||||
//LOGV("playCoreCommands 3 %i %i", cmdID, cmdSize);
|
||||
|
||||
if (cmdID >= (sizeof(gPlaybackFuncs) / sizeof(void *))) {
|
||||
rsAssert(cmdID < (sizeof(gPlaybackFuncs) / sizeof(void *)));
|
||||
LOGE("playCoreCommands error con %p, cmd %i", con, cmdID);
|
||||
}
|
||||
gPlaybackFuncs[cmdID](con, data);
|
||||
mToCore.next();
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ void printPlaybackCpp(FILE *f) {
|
||||
fprintf(f, "};\n\n");
|
||||
}
|
||||
|
||||
fprintf(f, "RsPlaybackFunc gPlaybackFuncs[] = {\n");
|
||||
fprintf(f, "RsPlaybackFunc gPlaybackFuncs[%i] = {\n", apiCount + 1);
|
||||
fprintf(f, " NULL,\n");
|
||||
for (ct=0; ct < apiCount; ct++) {
|
||||
fprintf(f, " %s%s,\n", "rsp_", apis[ct].name);
|
||||
@@ -265,7 +265,7 @@ int main(int argc, char **argv) {
|
||||
printFuncDecls(f, "rsi_", 1);
|
||||
printPlaybackFuncs(f, "rsp_");
|
||||
fprintf(f, "\n\ntypedef void (*RsPlaybackFunc)(Context *, const void *);\n");
|
||||
fprintf(f, "extern RsPlaybackFunc gPlaybackFuncs[];\n");
|
||||
fprintf(f, "extern RsPlaybackFunc gPlaybackFuncs[%i];\n", apiCount + 1);
|
||||
|
||||
fprintf(f, "}\n");
|
||||
fprintf(f, "}\n");
|
||||
|
||||
Reference in New Issue
Block a user