OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |