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