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

Side by Side Diff: gpu/config/gpu_util.cc

Issue 2751103008: gpu: Add a util method to set crash-keys from a GPUInfo. (Closed)
Patch Set: comment Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_util.h" 5 #include "gpu/config/gpu_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/debug/crash_logging.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
14 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/stringprintf.h"
15 #include "base/sys_info.h" 17 #include "base/sys_info.h"
16 #include "gpu/config/gpu_blacklist.h" 18 #include "gpu/config/gpu_blacklist.h"
17 #include "gpu/config/gpu_control_list_jsons.h" 19 #include "gpu/config/gpu_control_list_jsons.h"
20 #include "gpu/config/gpu_crash_keys.h"
18 #include "gpu/config/gpu_driver_bug_list.h" 21 #include "gpu/config/gpu_driver_bug_list.h"
19 #include "gpu/config/gpu_feature_type.h" 22 #include "gpu/config/gpu_feature_type.h"
20 #include "gpu/config/gpu_finch_features.h" 23 #include "gpu/config/gpu_finch_features.h"
21 #include "gpu/config/gpu_info_collector.h" 24 #include "gpu/config/gpu_info_collector.h"
22 #include "gpu/config/gpu_switches.h" 25 #include "gpu/config/gpu_switches.h"
23 #include "ui/gl/gl_switches.h" 26 #include "ui/gl/gl_switches.h"
24 #include "ui/gl/gpu_switching_manager.h" 27 #include "ui/gl/gpu_switching_manager.h"
25 28
26 namespace gpu { 29 namespace gpu {
27 30
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); 195 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info);
193 } 196 }
194 197
195 // Currently only used for GPU rasterization. 198 // Currently only used for GPU rasterization.
196 gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] = 199 gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
197 GetGpuRasterizationFeatureStatus(blacklisted_features, command_line); 200 GetGpuRasterizationFeatureStatus(blacklisted_features, command_line);
198 201
199 return gpu_feature_info; 202 return gpu_feature_info;
200 } 203 }
201 204
205 void SetKeysForCrashLogging(const GPUInfo& gpu_info) {
206 #if !defined(OS_ANDROID)
207 base::debug::SetCrashKeyValue(
208 crash_keys::kGPUVendorID,
209 base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id));
210 base::debug::SetCrashKeyValue(
211 crash_keys::kGPUDeviceID,
212 base::StringPrintf("0x%04x", gpu_info.gpu.device_id));
213 #endif
214 base::debug::SetCrashKeyValue(crash_keys::kGPUDriverVersion,
215 gpu_info.driver_version);
216 base::debug::SetCrashKeyValue(crash_keys::kGPUPixelShaderVersion,
217 gpu_info.pixel_shader_version);
218 base::debug::SetCrashKeyValue(crash_keys::kGPUVertexShaderVersion,
219 gpu_info.vertex_shader_version);
220 #if defined(OS_MACOSX)
221 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version);
222 #elif defined(OS_POSIX)
223 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor);
224 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer);
225 #endif
226 }
227
202 } // namespace gpu 228 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698