Index: gpu/config/gpu_info.cc |
diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc |
index 2d4548f6ed11540768e8aabb625b1e6ecbb6e01f..bf4e07dbecf84b3647537d0ce8da1288d09c7991 100644 |
--- a/gpu/config/gpu_info.cc |
+++ b/gpu/config/gpu_info.cc |
@@ -93,6 +93,17 @@ GPUInfo::GPUInfo(const GPUInfo& other) = default; |
GPUInfo::~GPUInfo() { } |
+const GPUInfo::GPUDevice& GPUInfo::active_gpu() const { |
+ if (gpu.active) |
+ return gpu; |
+ for (const GPUDevice& secondary_gpu : secondary_gpus) { |
+ if (secondary_gpu.active) |
+ return secondary_gpu; |
+ } |
+ DLOG(ERROR) << "No active GPU found, returning primary GPU."; |
+ return gpu; |
+} |
+ |
void GPUInfo::EnumerateFields(Enumerator* enumerator) const { |
struct GPUInfoKnownFields { |
base::TimeDelta initialization_time; |