diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 179: Android, SceneBuffer: Fix crash on implementations not supporting glMapBufferOES.

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

Commit Message

alexandros.frantzis@linaro.org Jan. 13, 2012, 3:07 p.m. UTC
Merge authors:
  Alexandros Frantzis (afrantzis)
------------------------------------------------------------
revno: 179 [merge]
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Fri 2012-01-13 15:51:25 +0200
message:
  Android,SceneBuffer: Fix crash on implementations not supporting glMapBufferOES.
modified:
  src/android.cpp
  src/scene-buffer.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	2011-11-08 20:20:02 +0000
+++ src/android.cpp	2012-01-13 13:48:41 +0000
@@ -105,11 +105,17 @@ 
             return false;
     }
 
-    g_canvas->clear();
-
-    scene->draw();
-    scene->update();
-
+    if (scene->is_running()) {
+        g_canvas->clear();
+
+        scene->draw();
+        scene->update();
+    }
+
+    /* 
+     * Need to recheck whether screen is running, because scene->update()
+     * may have changed the state.
+     */
     if (!scene->is_running()) {
         (*bench_iter)->teardown_scene();
         Log::info("%s FPS: %u", scene->info_string().c_str(), scene->average_fps());

=== modified file 'src/scene-buffer.cpp'
--- src/scene-buffer.cpp	2011-12-08 13:17:19 +0000
+++ src/scene-buffer.cpp	2012-01-13 13:50:31 +0000
@@ -343,6 +343,7 @@ 
 
     Scene::setup();
 
+    bool should_run = true;
     bool interleave = (options_["interleave"].value == "true");
     Mesh::VBOUpdateMethod update_method;
     Mesh::VBOUsage usage;
@@ -374,8 +375,8 @@ 
         (GLExtensions::MapBuffer == 0 || GLExtensions::UnmapBuffer == 0))
     {
         Log::error("Requested MapBuffer VBO update method but GL_OES_mapbuffer"
-                   "is not supported!");
-        return;
+                   " is not supported!\n");
+        should_run = false;
     }
 
     priv_->wave = new WaveMesh(5.0, 2.0, nlength, nwidth,
@@ -393,7 +394,7 @@ 
     glDisable(GL_CULL_FACE);
 
     currentFrame_ = 0;
-    running_ = true;
+    running_ = should_run;
     startTime_ = Util::get_timestamp_us() / 1000000.0;
     lastUpdateTime_ = startTime_;
 }