diff options
author | Jack Palevich <jackpal@google.com> | 2010-07-19 17:52:12 -0700 |
---|---|---|
committer | Jack Palevich <jackpal@google.com> | 2010-07-19 17:52:12 -0700 |
commit | 81d7aeb89d1630f54e0b45cb5669928528b0c21f (patch) | |
tree | fb4702f2367f85f4ae8851e33907b326a3cb578e /opengl | |
parent | 5a52b1ce2b377b521707f36307924b6184d40cf2 (diff) | |
download | frameworks_base-81d7aeb89d1630f54e0b45cb5669928528b0c21f.zip frameworks_base-81d7aeb89d1630f54e0b45cb5669928528b0c21f.tar.gz frameworks_base-81d7aeb89d1630f54e0b45cb5669928528b0c21f.tar.bz2 |
Try to handle end-of-application better.
Handle rotation from portrait to landscape by restarting test if not
finished.
Don't write blank line to csv file.
Change-Id: I154443138817bcec9530123c8388fcf659632336
Diffstat (limited to 'opengl')
-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 13b90bb..eafb665 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) |