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

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

Issue 12593005: Add a user pref in Settings to disable all GPU features. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 #if defined(OS_MACOSX) 7 #if defined(OS_MACOSX)
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #endif // OS_MACOSX 9 #endif // OS_MACOSX
10 10
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 489 }
490 #endif 490 #endif
491 } 491 }
492 492
493 GpuSwitchingOption GpuDataManagerImpl::GetGpuSwitchingOption() const { 493 GpuSwitchingOption GpuDataManagerImpl::GetGpuSwitchingOption() const {
494 if (!ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) 494 if (!ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus())
495 return GPU_SWITCHING_OPTION_UNKNOWN; 495 return GPU_SWITCHING_OPTION_UNKNOWN;
496 return gpu_switching_; 496 return gpu_switching_;
497 } 497 }
498 498
499 void GpuDataManagerImpl::BlacklistCard() { 499 void GpuDataManagerImpl::DisableHardwareAcceleration() {
500 card_blacklisted_ = true; 500 card_blacklisted_ = true;
501 501
502 blacklisted_features_ = GPU_FEATURE_TYPE_ALL; 502 blacklisted_features_ = GPU_FEATURE_TYPE_ALL;
503 503
504 EnableSoftwareRenderingIfNecessary(); 504 EnableSoftwareRenderingIfNecessary();
505 NotifyGpuInfoUpdate(); 505 NotifyGpuInfoUpdate();
506 } 506 }
507 507
508 std::string GpuDataManagerImpl::GetBlacklistVersion() const { 508 std::string GpuDataManagerImpl::GetBlacklistVersion() const {
509 if (gpu_blacklist_.get()) 509 if (gpu_blacklist_.get())
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 card_blacklisted_(false), 601 card_blacklisted_(false),
602 update_histograms_(true), 602 update_histograms_(true),
603 window_count_(0), 603 window_count_(0),
604 domain_blocking_enabled_(true) { 604 domain_blocking_enabled_(true) {
605 CommandLine* command_line = CommandLine::ForCurrentProcess(); 605 CommandLine* command_line = CommandLine::ForCurrentProcess();
606 if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { 606 if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) {
607 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); 607 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas);
608 command_line->AppendSwitch(switches::kDisableAcceleratedLayers); 608 command_line->AppendSwitch(switches::kDisableAcceleratedLayers);
609 } 609 }
610 if (command_line->HasSwitch(switches::kDisableGpu)) 610 if (command_line->HasSwitch(switches::kDisableGpu))
611 BlacklistCard(); 611 DisableHardwareAcceleration();
612 if (command_line->HasSwitch(switches::kGpuSwitching)) { 612 if (command_line->HasSwitch(switches::kGpuSwitching)) {
613 std::string option_string = command_line->GetSwitchValueASCII( 613 std::string option_string = command_line->GetSwitchValueASCII(
614 switches::kGpuSwitching); 614 switches::kGpuSwitching);
615 GpuSwitchingOption option = StringToGpuSwitchingOption(option_string); 615 GpuSwitchingOption option = StringToGpuSwitchingOption(option_string);
616 if (option != GPU_SWITCHING_OPTION_UNKNOWN) 616 if (option != GPU_SWITCHING_OPTION_UNKNOWN)
617 gpu_switching_ = option; 617 gpu_switching_ = option;
618 } 618 }
619 619
620 #if defined(OS_MACOSX) 620 #if defined(OS_MACOSX)
621 CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, this); 621 CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, this);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 806
807 void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& url, 807 void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& url,
808 int render_process_id, 808 int render_process_id,
809 int render_view_id, 809 int render_view_id,
810 ThreeDAPIType requester) { 810 ThreeDAPIType requester) {
811 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs, 811 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs,
812 url, render_process_id, render_view_id, requester); 812 url, render_process_id, render_view_id, requester);
813 } 813 }
814 814
815 } // namespace content 815 } // namespace content
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