diff mbox

[Branch,~glcompbench-dev/glcompbench/trunk] Rev 40: Display program information when starting.

Message ID 20110624155415.32360.51834.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org June 24, 2011, 3:54 p.m. UTC
------------------------------------------------------------
revno: 40
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Fri 2011-06-24 18:51:40 +0300
message:
  Display program information when starting.
modified:
  src/composite-canvas-egl.cc
  src/composite-canvas-egl.h
  src/composite-canvas-glx.cc
  src/composite-canvas-glx.h
  src/composite-canvas.h
  src/glcompbench.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/composite-canvas-egl.cc'
--- src/composite-canvas-egl.cc	2011-06-23 09:49:07 +0000
+++ src/composite-canvas-egl.cc	2011-06-24 15:51:40 +0000
@@ -22,6 +22,7 @@ 
  */
 
 #include <string>
+#include <sstream>
 
 #include "gl-headers.h"
 
@@ -273,3 +274,18 @@ 
     else
         glFinish();
 }
+
+std::string
+CompositeCanvasEGL::info_string()
+{
+    make_current();
+
+    std::stringstream ss;
+
+    ss << "    OpenGL Information" << std::endl;
+    ss << "    GL_VENDOR:     " << glGetString(GL_VENDOR) << std::endl;
+    ss << "    GL_RENDERER:   " << glGetString(GL_RENDERER) << std::endl;
+    ss << "    GL_VERSION:    " << glGetString(GL_VERSION) << std::endl;
+
+    return ss.str();
+}

=== modified file 'src/composite-canvas-egl.h'
--- src/composite-canvas-egl.h	2011-02-07 19:00:10 +0000
+++ src/composite-canvas-egl.h	2011-06-24 15:51:40 +0000
@@ -36,6 +36,8 @@ 
         egl_context_(0), egl_surface_(0),
         use_accel_tfp_(false) {}
 
+    std::string info_string();
+
 protected:
     XVisualInfo *get_canvas_xvisualinfo();
     bool make_current();

=== modified file 'src/composite-canvas-glx.cc'
--- src/composite-canvas-glx.cc	2011-06-24 13:31:15 +0000
+++ src/composite-canvas-glx.cc	2011-06-24 15:51:40 +0000
@@ -22,6 +22,7 @@ 
  */
 
 #include <string>
+#include <sstream>
 
 #include <GL/gl.h>
 #include <GL/glx.h>
@@ -218,3 +219,18 @@ 
     else
         glFinish();
 }
+
+std::string
+CompositeCanvasGLX::info_string()
+{
+    make_current();
+
+    std::stringstream ss;
+
+    ss << "    OpenGL Information" << std::endl;
+    ss << "    GL_VENDOR:     " << glGetString(GL_VENDOR) << std::endl;
+    ss << "    GL_RENDERER:   " << glGetString(GL_RENDERER) << std::endl;
+    ss << "    GL_VERSION:    " << glGetString(GL_VERSION) << std::endl;
+
+    return ss.str();
+}

=== modified file 'src/composite-canvas-glx.h'
--- src/composite-canvas-glx.h	2011-04-26 15:02:03 +0000
+++ src/composite-canvas-glx.h	2011-06-24 15:51:40 +0000
@@ -35,6 +35,8 @@ 
         glx_fbconfig_(0), glx_context_(0),
         use_accel_tfp_(false) {}
 
+    std::string info_string();
+
 protected:
     XVisualInfo *get_canvas_xvisualinfo();
     bool make_current();

=== modified file 'src/composite-canvas.h'
--- src/composite-canvas.h	2011-06-23 13:13:26 +0000
+++ src/composite-canvas.h	2011-06-24 15:51:40 +0000
@@ -51,6 +51,7 @@ 
 
     bool init();
     void run_tests(std::list<Benchmark*> &benchmarks);
+    virtual std::string info_string() { return std::string(); }
 
 protected:
     virtual XVisualInfo *get_canvas_xvisualinfo() = 0;

=== modified file 'src/glcompbench.cc'
--- src/glcompbench.cc	2011-06-23 13:52:16 +0000
+++ src/glcompbench.cc	2011-06-24 15:51:40 +0000
@@ -126,6 +126,13 @@ 
         add_custom_benchmarks(benchmarks);
 
     canvas.init();
+
+    Log::info("=======================================================\n");
+    Log::info("    glcompbench %s\n", GLCOMPBENCH_VERSION);
+    Log::info("=======================================================\n");
+    Log::info("%s", canvas.info_string().c_str());
+    Log::info("=======================================================\n");
+
     canvas.run_tests(benchmarks);
 
     return 0;