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 "content/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 bool success = gpu_driver_bug_list_->LoadList( | 996 bool success = gpu_driver_bug_list_->LoadList( |
997 gpu_driver_bug_list_json, gpu::GpuControlList::kCurrentOsOnly); | 997 gpu_driver_bug_list_json, gpu::GpuControlList::kCurrentOsOnly); |
998 DCHECK(success); | 998 DCHECK(success); |
999 } | 999 } |
1000 | 1000 |
1001 gpu_info_ = gpu_info; | 1001 gpu_info_ = gpu_info; |
1002 UpdateGpuInfo(gpu_info); | 1002 UpdateGpuInfo(gpu_info); |
1003 UpdateGpuSwitchingManager(gpu_info); | 1003 UpdateGpuSwitchingManager(gpu_info); |
1004 UpdatePreliminaryBlacklistedFeatures(); | 1004 UpdatePreliminaryBlacklistedFeatures(); |
1005 | 1005 |
1006 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
1007 // We pass down the list to GPU command buffer through commandline | |
1008 // switches at GPU process launch. However, in situations where we don't | |
1009 // have a GPU process, we append the browser process commandline. | |
1010 if (command_line->HasSwitch(switches::kSingleProcess) || | |
1011 command_line->HasSwitch(switches::kInProcessGPU)) { | |
1012 if (!gpu_driver_bugs_.empty()) { | |
1013 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, | |
1014 IntSetToString(gpu_driver_bugs_)); | |
1015 } | |
1016 } | |
1017 #if defined(OS_ANDROID) | 1006 #if defined(OS_ANDROID) |
1018 ApplyAndroidWorkarounds(gpu_info, command_line); | 1007 ApplyAndroidWorkarounds(gpu_info, CommandLine::ForCurrentProcess()); |
1019 #endif // OS_ANDROID | 1008 #endif // OS_ANDROID |
1020 } | 1009 } |
1021 | 1010 |
1022 void GpuDataManagerImplPrivate::UpdateBlacklistedFeatures( | 1011 void GpuDataManagerImplPrivate::UpdateBlacklistedFeatures( |
1023 const std::set<int>& features) { | 1012 const std::set<int>& features) { |
1024 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1013 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1025 blacklisted_features_ = features; | 1014 blacklisted_features_ = features; |
1026 | 1015 |
1027 // Force disable using the GPU for these features, even if they would | 1016 // Force disable using the GPU for these features, even if they would |
1028 // otherwise be allowed. | 1017 // otherwise be allowed. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 | 1166 |
1178 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1167 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1179 gpu_process_accessible_ = false; | 1168 gpu_process_accessible_ = false; |
1180 gpu_info_.finalized = true; | 1169 gpu_info_.finalized = true; |
1181 complete_gpu_info_already_requested_ = true; | 1170 complete_gpu_info_already_requested_ = true; |
1182 // Some observers might be waiting. | 1171 // Some observers might be waiting. |
1183 NotifyGpuInfoUpdate(); | 1172 NotifyGpuInfoUpdate(); |
1184 } | 1173 } |
1185 | 1174 |
1186 } // namespace content | 1175 } // namespace content |
OLD | NEW |