aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/tools
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2014-05-21 10:01:31 +0000
committerandroid-build-merger <android-build-merger@google.com>2014-05-21 10:01:31 +0000
commitf492ee5d0bbcedd3536ba691ba91b845f8be3779 (patch)
treef8f2141c9d1de18f6bc0f28211095ff3477882ca /emulator/opengl/host/tools
parentb98201d37a287ef318efc087b719bb65fa3924f0 (diff)
parent66ff42468f7dc836f73cc9507bdf8d6f21e17d7f (diff)
downloadsdk-f492ee5d0bbcedd3536ba691ba91b845f8be3779.zip
sdk-f492ee5d0bbcedd3536ba691ba91b845f8be3779.tar.gz
sdk-f492ee5d0bbcedd3536ba691ba91b845f8be3779.tar.bz2
Merge "emulator/opengl: A few debugging, stability improvements to emugl" into idea133
Auto-merge: 66ff424 * commit '66ff42468f7dc836f73cc9507bdf8d6f21e17d7f': emulator/opengl: A few debugging, stability improvements to emugl
Diffstat (limited to 'emulator/opengl/host/tools')
-rw-r--r--emulator/opengl/host/tools/emugen/ApiGen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/emulator/opengl/host/tools/emugen/ApiGen.cpp b/emulator/opengl/host/tools/emugen/ApiGen.cpp
index 6d6742d..2e4c8d1 100644
--- a/emulator/opengl/host/tools/emugen/ApiGen.cpp
+++ b/emulator/opengl/host/tools/emugen/ApiGen.cpp
@@ -821,7 +821,8 @@ int ApiGen::genDecoderImpl(const std::string &filename)
}
} else if (pass == PASS_DebugPrint) {
fprintf(fp, "#ifdef DEBUG_PRINTOUT\n");
- fprintf(fp, "\t\t\tfprintf(stderr,\"%s: %s(%s)\\n\"", m_basename.c_str(), e->name().c_str(), printString.c_str());
+ fprintf(fp, "\t\t\tfprintf(stderr,\"%s(%%p): %s(%s)\\n\", stream",
+ m_basename.c_str(), e->name().c_str(), printString.c_str());
if (e->vars().size() > 0 && !e->vars()[0].isVoid()) fprintf(fp, ",");
}
@@ -878,6 +879,9 @@ int ApiGen::genDecoderImpl(const std::string &filename)
} else if (pass == PASS_MemAlloc) {
fprintf(fp, "\t\t\tunsigned char *tmpPtr%u = &tmpBuf[%s];\n",
(unsigned)j, tmpBufOffset[j].c_str());
+ fprintf(fp, "\t\t\tmemset(tmpPtr%u, 0, %s);\n",
+ (unsigned)j,
+ toString(v->type()->bytes()).c_str());
} else if (pass == PASS_FunctionCall) {
if (v->nullAllowed()) {
fprintf(fp, "tmpPtr%uSize == 0 ? NULL : (%s)(tmpPtr%u)",
@@ -937,7 +941,7 @@ int ApiGen::genDecoderImpl(const std::string &filename)
fprintf(fp, "\t\t} //switch\n");
if (strstr(m_basename.c_str(), "gl")) {
fprintf(fp, "#ifdef CHECK_GL_ERROR\n");
- fprintf(fp, "\tint err = this->glGetError();\n");
+ fprintf(fp, "\tint err = lastCall[0] ? this->glGetError() : GL_NO_ERROR;\n");
fprintf(fp, "\tif (err) fprintf(stderr, \"%s Error: 0x%%X in %%s\\n\", err, lastCall);\n", m_basename.c_str());
fprintf(fp, "#endif\n");
}