From 0e8cac7f9ce4db3ba6c78f077d7db2861cab56a1 Mon Sep 17 00:00:00 2001 From: "piman@chromium.org" Date: Sat, 22 Mar 2014 00:37:18 +0000 Subject: Blacklist GLX indirect rendering Several part to this CL: 1- Implement gathering the direct rendering information. It needs a context, so it is done through the CollectGraphicsInfoGL hook 2- Implement logic to hook the information to the blacklist 3- In some cases, indirect rendering causes creating surfaces/contexts, needed to collect the info, to fail. So expose the failure mode (fatal vs non-fatal) to the caller so that we can fully fail GPU things in that case. BUG=72373,339244 Review URL: https://codereview.chromium.org/194303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258721 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gl/gl_glx_api_implementation.cc | 1 + ui/gl/gl_implementation.cc | 3 +++ ui/gl/gl_implementation.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/gl/gl_glx_api_implementation.cc b/ui/gl/gl_glx_api_implementation.cc index 444a1b2..0392c39 100644 --- a/ui/gl/gl_glx_api_implementation.cc +++ b/ui/gl/gl_glx_api_implementation.cc @@ -81,6 +81,7 @@ bool GetGLWindowSystemBindingInfoGLX(GLWindowSystemBindingInfo* info) { info->version = version; if (extensions) info->extensions = extensions; + info->direct_rendering = !!glXIsDirect(display, glXGetCurrentContext()); return true; } diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc index a7db8b0..9d6b34e 100644 --- a/ui/gl/gl_implementation.cc +++ b/ui/gl/gl_implementation.cc @@ -161,4 +161,7 @@ DisableNullDrawGLBindings::~DisableNullDrawGLBindings() { SetNullDrawGLBindingsEnabledGL(initial_enabled_); } +GLWindowSystemBindingInfo::GLWindowSystemBindingInfo() + : direct_rendering(true) {} + } // namespace gfx diff --git a/ui/gl/gl_implementation.h b/ui/gl/gl_implementation.h index 6f4eaf7..7319b47 100644 --- a/ui/gl/gl_implementation.h +++ b/ui/gl/gl_implementation.h @@ -27,10 +27,12 @@ enum GLImplementation { kGLImplementationMockGL }; -struct GLWindowSystemBindingInfo { +struct GL_EXPORT GLWindowSystemBindingInfo { + GLWindowSystemBindingInfo(); std::string vendor; std::string version; std::string extensions; + bool direct_rendering; }; void GetAllowedGLImplementations(std::vector* impls); -- cgit v1.1