[fiddle] Report GL driver info.
Bug: skia:
Change-Id: I5338d6abef062f7da420e8cddafa082bedcfff25
Reviewed-on: https://skia-review.googlesource.com/18310
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/tools/fiddle/egl_context.cpp b/tools/fiddle/egl_context.cpp
index cbab44c..107bb4f 100644
--- a/tools/fiddle/egl_context.cpp
+++ b/tools/fiddle/egl_context.cpp
@@ -8,6 +8,7 @@
#include "fiddle_main.h"
#include <EGL/egl.h>
+#include <GLES2/gl2.h>
static const EGLint configAttribs[] = {
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
@@ -29,7 +30,7 @@
};
// create_grcontext implementation for EGL.
-sk_sp<GrContext> create_grcontext() {
+sk_sp<GrContext> create_grcontext(std::ostringstream &driverinfo) {
EGLDisplay eglDpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (EGL_NO_DISPLAY == eglDpy) {
return nullptr;
@@ -63,6 +64,13 @@
return nullptr;
}
+ driverinfo << "EGL " << major << "." << minor << "\n";
+ GrGLGetStringProc getString = (GrGLGetStringProc )eglGetProcAddress("glGetString");
+ driverinfo << "GL Versionr: " << getString(GL_VERSION) << "\n";
+ driverinfo << "GL Vendor: " << getString(GL_VENDOR) << "\n";
+ driverinfo << "GL Renderer: " << getString(GL_RENDERER) << "\n";
+ driverinfo << "GL Extensions: " << getString(GL_EXTENSIONS) << "\n";
+
auto interface = GrGLCreateNativeInterface();
if (!interface) {
return nullptr;