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

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

Issue 1542013005: Add a new driver bug workaround SANDBOX_START_EARLY Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « gpu/config/gpu_util.h ('k') | gpu/config/gpu_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_util.h" 5 #include "gpu/config/gpu_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } // namespace anonymous 62 } // namespace anonymous
63 63
64 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { 64 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) {
65 DCHECK(dst); 65 DCHECK(dst);
66 if (src.empty()) 66 if (src.empty())
67 return; 67 return;
68 dst->insert(src.begin(), src.end()); 68 dst->insert(src.begin(), src.end());
69 } 69 }
70 70
71 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, 71 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info,
72 const std::string& os_version,
72 base::CommandLine* command_line) { 73 base::CommandLine* command_line) {
73 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); 74 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
74 list->LoadList(kGpuDriverBugListJson, 75 list->LoadList(kGpuDriverBugListJson,
75 GpuControlList::kCurrentOsOnly); 76 GpuControlList::kCurrentOsOnly);
76 std::set<int> workarounds = list->MakeDecision( 77 std::set<int> workarounds =
77 GpuControlList::kOsAny, std::string(), gpu_info); 78 list->MakeDecision(GpuControlList::kOsAny, os_version, gpu_info);
78 GpuDriverBugList::AppendWorkaroundsFromCommandLine( 79 GpuDriverBugList::AppendWorkaroundsFromCommandLine(
79 &workarounds, *command_line); 80 &workarounds, *command_line);
80 if (!workarounds.empty()) { 81 if (!workarounds.empty()) {
81 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, 82 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds,
82 IntSetToString(workarounds)); 83 IntSetToString(workarounds));
83 } 84 }
84 85
85 std::set<std::string> disabled_extensions; 86 std::set<std::string> disabled_extensions;
86 std::vector<std::string> buglist_disabled_extensions = 87 std::vector<std::string> buglist_disabled_extensions =
87 list->GetDisabledExtensions(); 88 list->GetDisabledExtensions();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 ui::GpuSwitchingManager::GetInstance(); 153 ui::GpuSwitchingManager::GetInstance();
153 if (!switching_manager->SupportsDualGpus()) 154 if (!switching_manager->SupportsDualGpus())
154 return; 155 return;
155 if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) 156 if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1)
156 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); 157 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu();
157 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) 158 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1)
158 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); 159 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu();
159 } 160 }
160 161
161 } // namespace gpu 162 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_util.h ('k') | gpu/config/gpu_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698