OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_linux.h" | 5 #include "gpu/config/gpu_info_collector_linux.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 #endif | 161 #endif |
162 } | 162 } |
163 | 163 |
164 } // namespace anonymous | 164 } // namespace anonymous |
165 | 165 |
166 CollectInfoResult CollectContextGraphicsInfo(GPUInfo* gpu_info) { | 166 CollectInfoResult CollectContextGraphicsInfo(GPUInfo* gpu_info) { |
167 DCHECK(gpu_info); | 167 DCHECK(gpu_info); |
168 | 168 |
169 TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo"); | 169 TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo"); |
170 | 170 |
171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
172 switches::kGpuNoContextLost)) { | |
173 gpu_info->can_lose_context = false; | |
174 } else { | |
175 #if defined(OS_CHROMEOS) | |
176 gpu_info->can_lose_context = false; | |
177 #else | |
178 // TODO(zmo): need to consider the case where we are running on top | |
179 // of desktop GL and GL_ARB_robustness extension is available. | |
180 gpu_info->can_lose_context = | |
181 (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2); | |
182 #endif | |
183 } | |
184 | |
185 CollectInfoResult result = CollectGraphicsInfoGL(gpu_info); | 171 CollectInfoResult result = CollectGraphicsInfoGL(gpu_info); |
186 gpu_info->context_info_state = result; | 172 gpu_info->context_info_state = result; |
187 return result; | 173 return result; |
188 } | 174 } |
189 | 175 |
190 CollectInfoResult CollectGpuID(uint32_t* vendor_id, uint32_t* device_id) { | 176 CollectInfoResult CollectGpuID(uint32_t* vendor_id, uint32_t* device_id) { |
191 DCHECK(vendor_id && device_id); | 177 DCHECK(vendor_id && device_id); |
192 *vendor_id = 0; | 178 *vendor_id = 0; |
193 *device_id = 0; | 179 *device_id = 0; |
194 | 180 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 gpu_info->driver_version = driver_version; | 271 gpu_info->driver_version = driver_version; |
286 return kCollectInfoSuccess; | 272 return kCollectInfoSuccess; |
287 } | 273 } |
288 | 274 |
289 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 275 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
290 const GPUInfo& context_gpu_info) { | 276 const GPUInfo& context_gpu_info) { |
291 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 277 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
292 } | 278 } |
293 | 279 |
294 } // namespace gpu | 280 } // namespace gpu |
OLD | NEW |