diff mbox

[Branch,~glcompbench-dev/glcompbench/trunk] Rev 77: glproxy: Adapted to new initialization API.

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

Commit Message

alexandros.frantzis@linaro.org Feb. 23, 2012, 10:45 a.m. UTC
------------------------------------------------------------
revno: 77
author: Marc Ordinas i Llopis <marc.ordinasillopis@linaro.org>
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Fri 2012-02-17 12:51:23 +0100
message:
  glproxy: Adapted to new initialization API.
modified:
  src/glcompbench.cc
  src/options.cc


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

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

Patch

=== modified file 'src/glcompbench.cc'
--- src/glcompbench.cc	2012-01-27 22:21:17 +0000
+++ src/glcompbench.cc	2012-02-17 11:51:23 +0000
@@ -142,6 +142,9 @@ 
 int
 main(int argc, char **argv)
 {
+#ifdef USE_GLPROXY
+    glProxyContext *proxy_context;
+#endif
     std::list<CompositeCanvas *> canvas_list;
     canvas_list.push_back(new CompositeCanvasPixman());
     canvas_list.push_back(new CompositeCanvasXRender());
@@ -160,15 +163,20 @@ 
 
 #ifdef USE_GLPROXY
     // Initialize the proxy library and create the correct GL canvas
-    PROXY_BACKEND_OPTION backend = UNKNOWN_BACKEND;
+    proxy_context = glProxyInit();
     if (Options::backend == Options::BACKEND_GLX) {
-        backend = OPENGL_BACKEND;
-        glProxyInit(&backend);
+        if (!glProxyLoad(proxy_context, GLPROXY_BACKEND_GLX_OPENGL))
+            return -1;
 
         canvas_list.push_back(new CompositeCanvasGLX());
     } else if (Options::backend == Options::BACKEND_EGL_ES2) {
-        backend = OPENGL_ES20_BACKEND;
-        glProxyInit(&backend);
+        if (!glProxyLoad(proxy_context, GLPROXY_BACKEND_EGL_OPENGLES2))
+            return -1;
+
+        canvas_list.push_back(new CompositeCanvasEGL());
+    } else if (Options::backend == Options::BACKEND_EGL_GL) {
+        if (!glProxyLoad(proxy_context, GLPROXY_BACKEND_EGL_OPENGL))
+            return -1;
 
         canvas_list.push_back(new CompositeCanvasEGL());
     } else {
@@ -263,5 +271,8 @@ 
 
     }
 
+#ifdef USE_GLPROXY
+    glProxyClose(proxy_context);
+#endif
     return 0;
 }

=== modified file 'src/options.cc'
--- src/options.cc	2011-12-14 12:49:09 +0000
+++ src/options.cc	2012-02-17 11:51:23 +0000
@@ -72,7 +72,7 @@ 
 };
 
 #ifdef USE_GLPROXY
-static const char *available_backends = "glx, egl-es2";
+static const char *available_backends = "glx, egl-es2, egl-gl";
 #elif defined(USE_GLX)
 static const char *available_backends = "glx";
 #elif defined(USE_EGL) && defined(USE_GL)