OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/config/gpu_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 str, " .,()-_", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 88 str, " .,()-_", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
89 for (size_t ii = 0; ii < tokens.size(); ++ii) { | 89 for (size_t ii = 0; ii < tokens.size(); ++ii) { |
90 for (size_t name_index = 0; name_index < num_names; ++name_index) { | 90 for (size_t name_index = 0; name_index < num_names; ++name_index) { |
91 if (tokens[ii] == names[name_index]) | 91 if (tokens[ii] == names[name_index]) |
92 return name_index; | 92 return name_index; |
93 } | 93 } |
94 } | 94 } |
95 return -1; | 95 return -1; |
96 } | 96 } |
97 | 97 |
98 } // namespace anonymous | 98 } // namespace |
99 | 99 |
100 namespace gpu { | 100 namespace gpu { |
101 | 101 |
102 CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) { | 102 CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) { |
103 TRACE_EVENT0("startup", "gpu_info_collector::CollectGraphicsInfoGL"); | 103 TRACE_EVENT0("startup", "gpu_info_collector::CollectGraphicsInfoGL"); |
104 DCHECK_NE(gl::GetGLImplementation(), gl::kGLImplementationNone); | 104 DCHECK_NE(gl::GetGLImplementation(), gl::kGLImplementationNone); |
105 | 105 |
106 scoped_refptr<gl::GLSurface> surface(InitializeGLSurface()); | 106 scoped_refptr<gl::GLSurface> surface(InitializeGLSurface()); |
107 if (!surface.get()) { | 107 if (!surface.get()) { |
108 LOG(ERROR) << "Could not create surface for info collection."; | 108 LOG(ERROR) << "Could not create surface for info collection."; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 gpu_info->gl_extensions.find("GL_EXT_multisampled_render_to_texture") != | 150 gpu_info->gl_extensions.find("GL_EXT_multisampled_render_to_texture") != |
151 std::string::npos || | 151 std::string::npos || |
152 gpu_info->gl_extensions.find("GL_NV_framebuffer_multisample") != | 152 gpu_info->gl_extensions.find("GL_NV_framebuffer_multisample") != |
153 std::string::npos) { | 153 std::string::npos) { |
154 glGetIntegerv(GL_MAX_SAMPLES, &max_samples); | 154 glGetIntegerv(GL_MAX_SAMPLES, &max_samples); |
155 } | 155 } |
156 gpu_info->max_msaa_samples = base::IntToString(max_samples); | 156 gpu_info->max_msaa_samples = base::IntToString(max_samples); |
157 UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.MaxMSAASampleCount", max_samples); | 157 UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.MaxMSAASampleCount", max_samples); |
158 | 158 |
159 gl::GLWindowSystemBindingInfo window_system_binding_info; | 159 gl::GLWindowSystemBindingInfo window_system_binding_info; |
160 if (GetGLWindowSystemBindingInfo(&window_system_binding_info)) { | 160 if (gl::init::GetGLWindowSystemBindingInfo(&window_system_binding_info)) { |
161 gpu_info->gl_ws_vendor = window_system_binding_info.vendor; | 161 gpu_info->gl_ws_vendor = window_system_binding_info.vendor; |
162 gpu_info->gl_ws_version = window_system_binding_info.version; | 162 gpu_info->gl_ws_version = window_system_binding_info.version; |
163 gpu_info->gl_ws_extensions = window_system_binding_info.extensions; | 163 gpu_info->gl_ws_extensions = window_system_binding_info.extensions; |
164 gpu_info->direct_rendering = window_system_binding_info.direct_rendering; | 164 gpu_info->direct_rendering = window_system_binding_info.direct_rendering; |
165 } | 165 } |
166 | 166 |
167 bool supports_robustness = | 167 bool supports_robustness = |
168 gpu_info->gl_extensions.find("GL_EXT_robustness") != std::string::npos || | 168 gpu_info->gl_extensions.find("GL_EXT_robustness") != std::string::npos || |
169 gpu_info->gl_extensions.find("GL_KHR_robustness") != std::string::npos || | 169 gpu_info->gl_extensions.find("GL_KHR_robustness") != std::string::npos || |
170 gpu_info->gl_extensions.find("GL_ARB_robustness") != std::string::npos; | 170 gpu_info->gl_extensions.find("GL_ARB_robustness") != std::string::npos; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 for (size_t ii = 0; ii < gpu_info->secondary_gpus.size(); ++ii) { | 281 for (size_t ii = 0; ii < gpu_info->secondary_gpus.size(); ++ii) { |
282 if (active_vendor_id == gpu_info->secondary_gpus[ii].vendor_id) { | 282 if (active_vendor_id == gpu_info->secondary_gpus[ii].vendor_id) { |
283 gpu_info->secondary_gpus[ii].active = true; | 283 gpu_info->secondary_gpus[ii].active = true; |
284 return; | 284 return; |
285 } | 285 } |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 } // namespace gpu | 289 } // namespace gpu |
290 | 290 |
OLD | NEW |