Merge lp:~marcoil/glcompbench/glproxy-flavor into lp:glcompbench

Proposed by Marc Ordinas i Llopis
Status: Merged
Merged at revision: 77
Proposed branch: lp:~marcoil/glcompbench/glproxy-flavor
Merge into: lp:glcompbench
Diff against target: 61 lines (+17/-6)
2 files modified
src/glcompbench.cc (+16/-5)
src/options.cc (+1/-1)
To merge this branch: bzr merge lp:~marcoil/glcompbench/glproxy-flavor
Reviewer Review Type Date Requested Status
Alexandros Frantzis Approve
Review via email: mp+93561@code.launchpad.net

Description of the change

Adapter glproxy flavor to the new initialization API in glproxy 0.4.0.

To post a comment you must log in.
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good! I will just cherrypick rev 72 (instead of doing a full merge) to keep history a bit cleaner.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/glcompbench.cc'
2--- src/glcompbench.cc 2012-01-27 22:21:17 +0000
3+++ src/glcompbench.cc 2012-02-17 11:55:24 +0000
4@@ -142,6 +142,9 @@
5 int
6 main(int argc, char **argv)
7 {
8+#ifdef USE_GLPROXY
9+ glProxyContext *proxy_context;
10+#endif
11 std::list<CompositeCanvas *> canvas_list;
12 canvas_list.push_back(new CompositeCanvasPixman());
13 canvas_list.push_back(new CompositeCanvasXRender());
14@@ -160,15 +163,20 @@
15
16 #ifdef USE_GLPROXY
17 // Initialize the proxy library and create the correct GL canvas
18- PROXY_BACKEND_OPTION backend = UNKNOWN_BACKEND;
19+ proxy_context = glProxyInit();
20 if (Options::backend == Options::BACKEND_GLX) {
21- backend = OPENGL_BACKEND;
22- glProxyInit(&backend);
23+ if (!glProxyLoad(proxy_context, GLPROXY_BACKEND_GLX_OPENGL))
24+ return -1;
25
26 canvas_list.push_back(new CompositeCanvasGLX());
27 } else if (Options::backend == Options::BACKEND_EGL_ES2) {
28- backend = OPENGL_ES20_BACKEND;
29- glProxyInit(&backend);
30+ if (!glProxyLoad(proxy_context, GLPROXY_BACKEND_EGL_OPENGLES2))
31+ return -1;
32+
33+ canvas_list.push_back(new CompositeCanvasEGL());
34+ } else if (Options::backend == Options::BACKEND_EGL_GL) {
35+ if (!glProxyLoad(proxy_context, GLPROXY_BACKEND_EGL_OPENGL))
36+ return -1;
37
38 canvas_list.push_back(new CompositeCanvasEGL());
39 } else {
40@@ -263,5 +271,8 @@
41
42 }
43
44+#ifdef USE_GLPROXY
45+ glProxyClose(proxy_context);
46+#endif
47 return 0;
48 }
49
50=== modified file 'src/options.cc'
51--- src/options.cc 2011-12-14 12:49:09 +0000
52+++ src/options.cc 2012-02-17 11:55:24 +0000
53@@ -72,7 +72,7 @@
54 };
55
56 #ifdef USE_GLPROXY
57-static const char *available_backends = "glx, egl-es2";
58+static const char *available_backends = "glx, egl-es2, egl-gl";
59 #elif defined(USE_GLX)
60 static const char *available_backends = "glx";
61 #elif defined(USE_EGL) && defined(USE_GL)

Subscribers

People subscribed via source and target branches