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

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

Issue 1503223005: Identify the active GPU using GL strings in multiple GPU situation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_control_list.h" 5 #include "gpu/config/gpu_control_list.h"
6 6
7 #include "base/cpu.h" 7 #include "base/cpu.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 entry->gl_type_ = GetDefaultGLType(); 789 entry->gl_type_ = GetDefaultGLType();
790 790
791 return entry; 791 return entry;
792 } 792 }
793 793
794 GpuControlList::GpuControlListEntry::GpuControlListEntry() 794 GpuControlList::GpuControlListEntry::GpuControlListEntry()
795 : id_(0), 795 : id_(0),
796 disabled_(false), 796 disabled_(false),
797 vendor_id_(0), 797 vendor_id_(0),
798 multi_gpu_style_(kMultiGpuStyleNone), 798 multi_gpu_style_(kMultiGpuStyleNone),
799 multi_gpu_category_(kMultiGpuCategoryPrimary), 799 multi_gpu_category_(kMultiGpuCategoryActive),
800 gl_type_(kGLTypeNone) { 800 gl_type_(kGLTypeNone) {
801 } 801 }
802 802
803 GpuControlList::GpuControlListEntry::~GpuControlListEntry() { } 803 GpuControlList::GpuControlListEntry::~GpuControlListEntry() { }
804 804
805 bool GpuControlList::GpuControlListEntry::SetId(uint32 id) { 805 bool GpuControlList::GpuControlListEntry::SetId(uint32 id) {
806 if (id != 0) { 806 if (id != 0) {
807 id_ = id; 807 id_ = id;
808 return true; 808 return true;
809 } 809 }
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 candidates.push_back(gpu_info.gpu); 1139 candidates.push_back(gpu_info.gpu);
1140 break; 1140 break;
1141 case kMultiGpuCategorySecondary: 1141 case kMultiGpuCategorySecondary:
1142 candidates = gpu_info.secondary_gpus; 1142 candidates = gpu_info.secondary_gpus;
1143 break; 1143 break;
1144 case kMultiGpuCategoryAny: 1144 case kMultiGpuCategoryAny:
1145 candidates = gpu_info.secondary_gpus; 1145 candidates = gpu_info.secondary_gpus;
1146 candidates.push_back(gpu_info.gpu); 1146 candidates.push_back(gpu_info.gpu);
1147 break; 1147 break;
1148 case kMultiGpuCategoryActive: 1148 case kMultiGpuCategoryActive:
1149 if (gpu_info.gpu.active) 1149 if (gpu_info.gpu.active || gpu_info.secondary_gpus.empty())
1150 candidates.push_back(gpu_info.gpu); 1150 candidates.push_back(gpu_info.gpu);
1151 for (size_t ii = 0; ii < gpu_info.secondary_gpus.size(); ++ii) { 1151 for (size_t ii = 0; ii < gpu_info.secondary_gpus.size(); ++ii) {
1152 if (gpu_info.secondary_gpus[ii].active) 1152 if (gpu_info.secondary_gpus[ii].active)
1153 candidates.push_back(gpu_info.secondary_gpus[ii]); 1153 candidates.push_back(gpu_info.secondary_gpus[ii]);
1154 } 1154 }
1155 default: 1155 default:
1156 break; 1156 break;
1157 } 1157 }
1158 1158
1159 GPUInfo::GPUDevice gpu; 1159 GPUInfo::GPUDevice gpu;
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 const std::string& feature_name, int feature_id) { 1580 const std::string& feature_name, int feature_id) {
1581 feature_map_[feature_name] = feature_id; 1581 feature_map_[feature_name] = feature_id;
1582 } 1582 }
1583 1583
1584 void GpuControlList::set_supports_feature_type_all(bool supported) { 1584 void GpuControlList::set_supports_feature_type_all(bool supported) {
1585 supports_feature_type_all_ = supported; 1585 supports_feature_type_all_ = supported;
1586 } 1586 }
1587 1587
1588 } // namespace gpu 1588 } // namespace gpu
1589 1589
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | gpu/config/gpu_control_list_entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698