diff options
| author | 2010-07-19 17:52:52 -0700 | |
|---|---|---|
| committer | 2010-07-19 17:52:52 -0700 | |
| commit | 3c6f1b38b725ed508850f993a66a8edf64724c2a (patch) | |
| tree | 110b52044afec1f33afd092778b63a49e8a8e821 | |
| parent | 621fa795a93a41ac3cd0f6b3cd8400c2c1f2e600 (diff) | |
| parent | 81d7aeb89d1630f54e0b45cb5669928528b0c21f (diff) | |
Merge "Try to handle end-of-application better."
| -rw-r--r-- | opengl/tests/gl_perfapp/jni/gl_code.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/opengl/tests/gl_perfapp/jni/gl_code.cpp b/opengl/tests/gl_perfapp/jni/gl_code.cpp index 13b90bb5fa1a..eafb665d091f 100644 --- a/opengl/tests/gl_perfapp/jni/gl_code.cpp +++ b/opengl/tests/gl_perfapp/jni/gl_code.cpp @@ -124,7 +124,10 @@ void endTimer(const char *str, int w, int h, double dc, int count) { double dc60 = pixels / delta / (w * h) / 60; LOGI("%s, %f, %f\n", str, mpps, dc60); - if (out) fprintf(out, "%s, %f, %f\r\n", str, mpps, dc60); + if (out) { + fprintf(out, "%s, %f, %f\r\n", str, mpps, dc60); + fflush(out); + } } static const char gVertexShader[] = @@ -397,7 +400,6 @@ void doTest(uint32_t w, uint32_t h) { out = NULL; } done = true; - exit(0); return; } @@ -440,21 +442,28 @@ extern "C" { JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobject obj, jint width, jint height) { - w = width; - h = height; - stateClock = 0; - done = false; - setupVA(); - genTextures(); - const char* fileName = "/sdcard/glperf.csv"; - LOGI("Writing to: %s\n",fileName); - out = fopen(fileName, "w"); - if (out == NULL) { - LOGE("Could not open: %s\n", fileName); - } + if (!done) { + w = width; + h = height; + stateClock = 0; + done = false; + setupVA(); + genTextures(); + const char* fileName = "/sdcard/glperf.csv"; + if (out != NULL) { + LOGI("Closing partially written output.n"); + fclose(out); + out = NULL; + } + LOGI("Writing to: %s\n",fileName); + out = fopen(fileName, "w"); + if (out == NULL) { + LOGE("Could not open: %s\n", fileName); + } - LOGI("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n"); - if (out) fprintf(out,"\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\r\n"); + LOGI("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n"); + if (out) fprintf(out,"varColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\r\n"); + } } JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_step(JNIEnv * env, jobject obj) |