| 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 "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 DCHECK(vendor_id && device_id); | 92 DCHECK(vendor_id && device_id); |
| 93 *vendor_id = 0; | 93 *vendor_id = 0; |
| 94 *device_id = 0; | 94 *device_id = 0; |
| 95 return kGpuIDNotSupported; | 95 return kGpuIDNotSupported; |
| 96 } | 96 } |
| 97 | 97 |
| 98 CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { | 98 CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { |
| 99 gpu_info->can_lose_context = false; | 99 gpu_info->can_lose_context = false; |
| 100 gpu_info->finalized = true; | 100 gpu_info->finalized = true; |
| 101 | 101 |
| 102 gpu_info->machine_model = base::android::BuildInfo::GetInstance()->model(); | 102 gpu_info->machine_model_name = |
| 103 base::android::BuildInfo::GetInstance()->model(); |
| 103 | 104 |
| 104 // Create a short-lived context on the UI thread to collect the GL strings. | 105 // Create a short-lived context on the UI thread to collect the GL strings. |
| 105 // Make sure we restore the existing context if there is one. | 106 // Make sure we restore the existing context if there is one. |
| 106 ScopedRestoreNonOwnedEGLContext restore_context; | 107 ScopedRestoreNonOwnedEGLContext restore_context; |
| 107 return CollectGraphicsInfoGL(gpu_info); | 108 return CollectGraphicsInfoGL(gpu_info); |
| 108 } | 109 } |
| 109 | 110 |
| 110 CollectInfoResult CollectDriverInfoGL(GPUInfo* gpu_info) { | 111 CollectInfoResult CollectDriverInfoGL(GPUInfo* gpu_info) { |
| 111 gpu_info->driver_version = GetDriverVersionFromString( | 112 gpu_info->driver_version = GetDriverVersionFromString( |
| 112 gpu_info->gl_version_string); | 113 gpu_info->gl_version_string); |
| 113 gpu_info->gpu.vendor_string = gpu_info->gl_vendor; | 114 gpu_info->gpu.vendor_string = gpu_info->gl_vendor; |
| 114 gpu_info->gpu.device_string = gpu_info->gl_renderer; | 115 gpu_info->gpu.device_string = gpu_info->gl_renderer; |
| 115 return kCollectInfoSuccess; | 116 return kCollectInfoSuccess; |
| 116 } | 117 } |
| 117 | 118 |
| 118 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 119 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
| 119 const GPUInfo& context_gpu_info) { | 120 const GPUInfo& context_gpu_info) { |
| 120 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 121 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
| 121 } | 122 } |
| 122 | 123 |
| 123 } // namespace gpu | 124 } // namespace gpu |
| OLD | NEW |