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.h" | 5 #include "content/browser/gpu/gpu_data_manager.h" |
6 | 6 |
7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
8 #include <CoreGraphics/CGDisplayConfiguration.h> | 8 #include <CoreGraphics/CGDisplayConfiguration.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)) && | 496 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)) && |
497 (user_flags_.use_gl() == "any")) { | 497 (user_flags_.use_gl() == "any")) { |
498 command_line->AppendSwitchASCII( | 498 command_line->AppendSwitchASCII( |
499 switches::kUseGL, gfx::kGLImplementationOSMesaName); | 499 switches::kUseGL, gfx::kGLImplementationOSMesaName); |
500 } else if (!user_flags_.use_gl().empty()) { | 500 } else if (!user_flags_.use_gl().empty()) { |
501 command_line->AppendSwitchASCII(switches::kUseGL, user_flags_.use_gl()); | 501 command_line->AppendSwitchASCII(switches::kUseGL, user_flags_.use_gl()); |
502 } | 502 } |
503 | 503 |
504 if (gpu_info().optimus) | 504 if (gpu_info().optimus) |
505 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 505 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
| 506 if (gpu_info().amd_switchable) { |
| 507 // The image transport surface currently doesn't work with AMD Dynamic |
| 508 // Switchable graphics. |
| 509 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
| 510 command_line->AppendSwitch(switches::kDisableImageTransportSurface); |
| 511 } |
506 } | 512 } |
507 | 513 |
508 void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) { | 514 void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) { |
509 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 515 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
510 DCHECK(gpu_blacklist); | 516 DCHECK(gpu_blacklist); |
511 gpu_blacklist_.reset(gpu_blacklist); | 517 gpu_blacklist_.reset(gpu_blacklist); |
512 UpdateGpuFeatureFlags(); | 518 UpdateGpuFeatureFlags(); |
513 preliminary_gpu_feature_flags_ = gpu_feature_flags_; | 519 preliminary_gpu_feature_flags_ = gpu_feature_flags_; |
514 } | 520 } |
515 | 521 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 object->vendor_id != other.vendor_id) { | 735 object->vendor_id != other.vendor_id) { |
730 *object = other; | 736 *object = other; |
731 return true; | 737 return true; |
732 } | 738 } |
733 | 739 |
734 bool changed = false; | 740 bool changed = false; |
735 if (!object->finalized) { | 741 if (!object->finalized) { |
736 object->finalized = other.finalized; | 742 object->finalized = other.finalized; |
737 object->initialization_time = other.initialization_time; | 743 object->initialization_time = other.initialization_time; |
738 object->optimus |= other.optimus; | 744 object->optimus |= other.optimus; |
| 745 object->amd_switchable |= other.amd_switchable; |
739 | 746 |
740 if (object->driver_vendor.empty()) { | 747 if (object->driver_vendor.empty()) { |
741 changed |= object->driver_vendor != other.driver_vendor; | 748 changed |= object->driver_vendor != other.driver_vendor; |
742 object->driver_vendor = other.driver_vendor; | 749 object->driver_vendor = other.driver_vendor; |
743 } | 750 } |
744 if (object->driver_version.empty()) { | 751 if (object->driver_version.empty()) { |
745 changed |= object->driver_version != other.driver_version; | 752 changed |= object->driver_version != other.driver_version; |
746 object->driver_version = other.driver_version; | 753 object->driver_version = other.driver_version; |
747 } | 754 } |
748 if (object->driver_date.empty()) { | 755 if (object->driver_date.empty()) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 799 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
793 if (gpu_info_.can_lose_context) | 800 if (gpu_info_.can_lose_context) |
794 return false; | 801 return false; |
795 #if defined(USE_SKIA) | 802 #if defined(USE_SKIA) |
796 return true; | 803 return true; |
797 #else | 804 #else |
798 return false; | 805 return false; |
799 #endif | 806 #endif |
800 } | 807 } |
801 | 808 |
OLD | NEW |