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