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

Side by Side Diff: chrome/browser/component_updater/swiftshader_component_installer.cc

Issue 13983014: [CLOSED] Cleaning up the plethora of switches for GPU vs software vs SwiftShader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/gpu/compositor_util.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 "chrome/browser/component_updater/swiftshader_component_installer.h" 5 #include "chrome/browser/component_updater/swiftshader_component_installer.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/cpu.h" 10 #include "base/cpu.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) 174 UpdateChecker::UpdateChecker(ComponentUpdateService* cus)
175 : cus_(cus) { 175 : cus_(cus) {
176 } 176 }
177 177
178 void UpdateChecker::OnGpuInfoUpdate() { 178 void UpdateChecker::OnGpuInfoUpdate() {
179 GpuDataManager *gpu_data_manager = GpuDataManager::GetInstance(); 179 GpuDataManager *gpu_data_manager = GpuDataManager::GetInstance();
180 180
181 if (!gpu_data_manager->GpuAccessAllowed() || 181 if (!gpu_data_manager->GpuAccessAllowed() ||
182 gpu_data_manager->IsFeatureBlacklisted(content::GPU_FEATURE_TYPE_WEBGL) || 182 gpu_data_manager->IsFeatureBlacklisted(content::GPU_FEATURE_TYPE_WEBGL) ||
183 gpu_data_manager->ShouldUseSoftwareRendering()) { 183 gpu_data_manager->ShouldUseSwiftShader()) {
184 gpu_data_manager->RemoveObserver(this); 184 gpu_data_manager->RemoveObserver(this);
185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
186 base::FilePath path = GetSwiftShaderBaseDirectory(); 186 base::FilePath path = GetSwiftShaderBaseDirectory();
187 187
188 Version version(kNullVersion); 188 Version version(kNullVersion);
189 GetLatestSwiftShaderDirectory(&path, &version, NULL); 189 GetLatestSwiftShaderDirectory(&path, &version, NULL);
190 190
191 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 191 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
192 base::Bind(&FinishSwiftShaderUpdateRegistration, cus_, version)); 192 base::Bind(&FinishSwiftShaderUpdateRegistration, cus_, version));
193 } 193 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { 227 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) {
228 #if defined(ENABLE_SWIFTSHADER) 228 #if defined(ENABLE_SWIFTSHADER)
229 base::CPU cpu; 229 base::CPU cpu;
230 230
231 if (!cpu.has_sse2()) 231 if (!cpu.has_sse2())
232 return; 232 return;
233 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 233 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
234 base::Bind(&RegisterSwiftShaderPath, cus)); 234 base::Bind(&RegisterSwiftShaderPath, cus));
235 #endif 235 #endif
236 } 236 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/compositor_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698