diff options
Diffstat (limited to 'content/gpu/gpu_info_collector.cc')
-rw-r--r-- | content/gpu/gpu_info_collector.cc | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc index 14b1697..6d13b29 100644 --- a/content/gpu/gpu_info_collector.cc +++ b/content/gpu/gpu_info_collector.cc @@ -94,32 +94,44 @@ bool CollectGraphicsInfoGL(content::GPUInfo* gpu_info) { gpu_info->gl_renderer = GetGLString(GL_RENDERER); gpu_info->gl_vendor = GetGLString(GL_VENDOR); - gpu_info->gl_version_string =GetGLString(GL_VERSION); - gpu_info->gl_extensions =GetGLString(GL_EXTENSIONS); - - bool validGLVersionInfo = CollectGLVersionInfo(gpu_info); - bool validVideoCardInfo = CollectVideoCardInfo(gpu_info); - bool validDriverInfo = CollectDriverInfoGL(gpu_info); - + gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS); + gpu_info->gl_version_string = GetGLString(GL_VERSION); + std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION); // TODO(kbr): remove once the destruction of a current context automatically // clears the current context. context->ReleaseCurrent(surface.get()); - return (validGLVersionInfo && validVideoCardInfo && validDriverInfo); -} - -bool CollectGLVersionInfo(content::GPUInfo* gpu_info) { - std::string gl_version_string = gpu_info->gl_version_string; - std::string glsl_version_string = - GetGLString(GL_SHADING_LANGUAGE_VERSION); - - gpu_info->gl_version = GetVersionFromString(gl_version_string); - + gpu_info->gl_version = GetVersionFromString(gpu_info->gl_version_string); std::string glsl_version = GetVersionFromString(glsl_version_string); gpu_info->pixel_shader_version = glsl_version; gpu_info->vertex_shader_version = glsl_version; - return true; + return CollectDriverInfoGL(gpu_info); +} + +void MergeGPUInfoGL(content::GPUInfo* basic_gpu_info, + const content::GPUInfo& context_gpu_info) { + DCHECK(basic_gpu_info); + basic_gpu_info->gl_renderer = context_gpu_info.gl_renderer; + basic_gpu_info->gl_vendor = context_gpu_info.gl_vendor; + basic_gpu_info->gl_version_string = context_gpu_info.gl_version_string; + basic_gpu_info->gl_extensions = context_gpu_info.gl_extensions; + basic_gpu_info->gl_version = context_gpu_info.gl_version; + basic_gpu_info->pixel_shader_version = + context_gpu_info.pixel_shader_version; + basic_gpu_info->vertex_shader_version = + context_gpu_info.vertex_shader_version; + + if (!context_gpu_info.driver_vendor.empty()) + basic_gpu_info->driver_vendor = context_gpu_info.driver_vendor; + if (!context_gpu_info.driver_version.empty()) + basic_gpu_info->driver_version = context_gpu_info.driver_version; + + basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context; + basic_gpu_info->sandboxed = context_gpu_info.sandboxed; + basic_gpu_info->gpu_accessible = context_gpu_info.gpu_accessible; + basic_gpu_info->finalized = context_gpu_info.finalized; + basic_gpu_info->initialization_time = context_gpu_info.initialization_time; } } // namespace gpu_info_collector |