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 "content/browser/gpu/gpu_data_manager_impl.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl.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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 void GpuDataManagerImpl::RegisterSwiftShaderPath(const FilePath& path) { | 444 void GpuDataManagerImpl::RegisterSwiftShaderPath(const FilePath& path) { |
445 swiftshader_path_ = path; | 445 swiftshader_path_ = path; |
446 EnableSoftwareRenderingIfNecessary(); | 446 EnableSoftwareRenderingIfNecessary(); |
447 } | 447 } |
448 | 448 |
449 void GpuDataManagerImpl::EnableSoftwareRenderingIfNecessary() { | 449 void GpuDataManagerImpl::EnableSoftwareRenderingIfNecessary() { |
450 if (!GpuAccessAllowed() || | 450 if (!GpuAccessAllowed() || |
451 (gpu_feature_type_ & content::GPU_FEATURE_TYPE_WEBGL)) { | 451 (gpu_feature_type_ & content::GPU_FEATURE_TYPE_WEBGL)) { |
452 #if defined(ENABLE_SWIFTSHADER) | |
453 if (!swiftshader_path_.empty() && | 452 if (!swiftshader_path_.empty() && |
454 !CommandLine::ForCurrentProcess()->HasSwitch( | 453 !CommandLine::ForCurrentProcess()->HasSwitch( |
455 switches::kDisableSoftwareRasterizer)) | 454 switches::kDisableSoftwareRasterizer)) |
456 software_rendering_ = true; | 455 software_rendering_ = true; |
457 #endif | |
458 } | 456 } |
459 } | 457 } |
460 | 458 |
461 bool GpuDataManagerImpl::ShouldUseSoftwareRendering() const { | 459 bool GpuDataManagerImpl::ShouldUseSoftwareRendering() const { |
462 return software_rendering_; | 460 return software_rendering_; |
463 } | 461 } |
464 | 462 |
465 void GpuDataManagerImpl::BlacklistCard() { | 463 void GpuDataManagerImpl::BlacklistCard() { |
466 card_blacklisted_ = true; | 464 card_blacklisted_ = true; |
467 | 465 |
468 gpu_feature_type_ = content::GPU_FEATURE_TYPE_ALL; | 466 gpu_feature_type_ = content::GPU_FEATURE_TYPE_ALL; |
469 | 467 |
470 EnableSoftwareRenderingIfNecessary(); | 468 EnableSoftwareRenderingIfNecessary(); |
471 NotifyGpuInfoUpdate(); | 469 NotifyGpuInfoUpdate(); |
472 } | 470 } |
473 | |
OLD | NEW |