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

Unified Diff: content/gpu/gpu_info_collector.cc

Issue 11576056: Attempt to reland r173248,173259 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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 | « content/gpu/gpu_info_collector.h ('k') | content/gpu/gpu_info_collector_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_info_collector.cc
===================================================================
--- content/gpu/gpu_info_collector.cc (revision 173496)
+++ content/gpu/gpu_info_collector.cc (working copy)
@@ -94,33 +94,45 @@
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
« no previous file with comments | « content/gpu/gpu_info_collector.h ('k') | content/gpu/gpu_info_collector_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698