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

Unified Diff: gpu/config/gpu_info.cc

Issue 2878163002: Fix bug whereby OnGpuSwitched was never called (Closed)
Patch Set: Add missed file Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_info.h ('k') | gpu/ipc/service/image_transport_surface_overlay_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « gpu/config/gpu_info.h ('k') | gpu/ipc/service/image_transport_surface_overlay_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698