Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: gpu/config/gpu_info_collector.cc

Issue 2347383002: X11: Use better visuals for OpenGL (Closed)
Patch Set: auto* Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_info.cc ('k') | gpu/ipc/common/gpu_info.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_info_collector.cc
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 527f85ea5a00696dbb27e1874c03d9647c604760..760caf99645bb35804ea224930f7ddbb0ff9c1c7 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -26,6 +26,10 @@
#include "ui/gl/gl_version_info.h"
#include "ui/gl/init/gl_factory.h"
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+#include "ui/gl/gl_visual_picker_glx.h"
+#endif
+
namespace {
scoped_refptr<gl::GLSurface> InitializeGLSurface() {
@@ -173,6 +177,14 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) {
reinterpret_cast<GLint*>(&gpu_info->gl_reset_notification_strategy));
}
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+ if (gl::GetGLImplementation() == gl::kGLImplementationDesktopGL) {
+ gl::GLVisualPickerGLX* visual_picker = gl::GLVisualPickerGLX::GetInstance();
+ gpu_info->system_visual = visual_picker->system_visual().visualid;
+ gpu_info->rgba_visual = visual_picker->rgba_visual().visualid;
+ }
+#endif
+
// TODO(kbr): remove once the destruction of a current context automatically
// clears the current context.
context->ReleaseCurrent(surface.get());
@@ -224,6 +236,11 @@ void MergeGPUInfoGL(GPUInfo* basic_gpu_info,
context_gpu_info.video_encode_accelerator_supported_profiles;
basic_gpu_info->jpeg_decode_accelerator_supported =
context_gpu_info.jpeg_decode_accelerator_supported;
+
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+ basic_gpu_info->system_visual = context_gpu_info.system_visual;
+ basic_gpu_info->rgba_visual = context_gpu_info.rgba_visual;
+#endif
}
void IdentifyActiveGPU(GPUInfo* gpu_info) {
@@ -286,4 +303,3 @@ void IdentifyActiveGPU(GPUInfo* gpu_info) {
}
} // namespace gpu
-
« no previous file with comments | « gpu/config/gpu_info.cc ('k') | gpu/ipc/common/gpu_info.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698