diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 180: Android: Display glmark2 score when finishing.

Message ID 20120113150714.16017.11386.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org Jan. 13, 2012, 3:07 p.m. UTC
------------------------------------------------------------
revno: 180
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Fri 2012-01-13 16:03:23 +0200
message:
  Android: Display glmark2 score when finishing.
modified:
  src/android.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/android.cpp'
--- src/android.cpp	2012-01-13 13:48:41 +0000
+++ src/android.cpp	2012-01-13 14:03:23 +0000
@@ -96,13 +96,19 @@ 
 {
     static std::vector<Benchmark *>::iterator bench_iter = g_benchmarks.begin();
     static Scene *scene = 0;
+    static unsigned int score = 0;
+    static unsigned int benchmarks_run = 0;
 
     if (!scene) {
         if (bench_iter != g_benchmarks.end()) {
             scene = &(*bench_iter)->setup_scene();
         }
-        else
+        else {
+            if (benchmarks_run)
+                score /= benchmarks_run;
+            Log::info("glmark2 Score: %u\n", score);
             return false;
+        }
     }
 
     if (scene->is_running()) {
@@ -117,10 +123,12 @@ 
      * may have changed the state.
      */
     if (!scene->is_running()) {
+        Log::info("%s FPS: %u", scene->info_string().c_str(), scene->average_fps());
+        score += scene->average_fps();
         (*bench_iter)->teardown_scene();
-        Log::info("%s FPS: %u", scene->info_string().c_str(), scene->average_fps());
         scene = 0;
         bench_iter++;
+        benchmarks_run++;
     }
 
     return true;