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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl.cc

Issue 10968042: Some extra testing for GpuDataManager. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
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 "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
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
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.h ('k') | content/browser/gpu/gpu_data_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698