Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92a9ae4a authored by Jack Palevich's avatar Jack Palevich
Browse files

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
parent 63bcb5f8
Loading
Loading
Loading
Loading
+25 −16
Original line number Diff line number Diff line
@@ -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,6 +442,7 @@ extern "C" {

JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobject obj,  jint width, jint height)
{
    if (!done) {
	    w = width;
	    h = height;
	    stateClock = 0;
@@ -447,6 +450,11 @@ JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobj
	    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) {
@@ -454,7 +462,8 @@ JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobj
	    }

	    LOGI("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n");
    if (out) fprintf(out,"\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\r\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)