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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)) && | 500 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)) && |
501 (user_flags_.use_gl() == "any")) { | 501 (user_flags_.use_gl() == "any")) { |
502 command_line->AppendSwitchASCII( | 502 command_line->AppendSwitchASCII( |
503 switches::kUseGL, gfx::kGLImplementationOSMesaName); | 503 switches::kUseGL, gfx::kGLImplementationOSMesaName); |
504 } else if (!user_flags_.use_gl().empty()) { | 504 } else if (!user_flags_.use_gl().empty()) { |
505 command_line->AppendSwitchASCII(switches::kUseGL, user_flags_.use_gl()); | 505 command_line->AppendSwitchASCII(switches::kUseGL, user_flags_.use_gl()); |
506 } | 506 } |
507 | 507 |
508 if (gpu_info().optimus) | 508 if (gpu_info().optimus) |
509 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 509 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
| 510 if (gpu_info().amd_switchable) { |
| 511 // The image transport surface currently doesn't work with AMD Dynamic |
| 512 // Switchable graphics. |
| 513 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
| 514 command_line->AppendSwitch(switches::kDisableImageTransportSurface); |
| 515 } |
510 } | 516 } |
511 | 517 |
512 void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) { | 518 void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) { |
513 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 519 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
514 DCHECK(gpu_blacklist); | 520 DCHECK(gpu_blacklist); |
515 gpu_blacklist_.reset(gpu_blacklist); | 521 gpu_blacklist_.reset(gpu_blacklist); |
516 UpdateGpuFeatureFlags(); | 522 UpdateGpuFeatureFlags(); |
517 preliminary_gpu_feature_flags_ = gpu_feature_flags_; | 523 preliminary_gpu_feature_flags_ = gpu_feature_flags_; |
518 } | 524 } |
519 | 525 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 object->vendor_id != other.vendor_id) { | 727 object->vendor_id != other.vendor_id) { |
722 *object = other; | 728 *object = other; |
723 return true; | 729 return true; |
724 } | 730 } |
725 | 731 |
726 bool changed = false; | 732 bool changed = false; |
727 if (!object->finalized) { | 733 if (!object->finalized) { |
728 object->finalized = other.finalized; | 734 object->finalized = other.finalized; |
729 object->initialization_time = other.initialization_time; | 735 object->initialization_time = other.initialization_time; |
730 object->optimus |= other.optimus; | 736 object->optimus |= other.optimus; |
| 737 object->amd_switchable |= other.amd_switchable; |
731 | 738 |
732 if (object->driver_vendor.empty()) { | 739 if (object->driver_vendor.empty()) { |
733 changed |= object->driver_vendor != other.driver_vendor; | 740 changed |= object->driver_vendor != other.driver_vendor; |
734 object->driver_vendor = other.driver_vendor; | 741 object->driver_vendor = other.driver_vendor; |
735 } | 742 } |
736 if (object->driver_version.empty()) { | 743 if (object->driver_version.empty()) { |
737 changed |= object->driver_version != other.driver_version; | 744 changed |= object->driver_version != other.driver_version; |
738 object->driver_version = other.driver_version; | 745 object->driver_version = other.driver_version; |
739 } | 746 } |
740 if (object->driver_date.empty()) { | 747 if (object->driver_date.empty()) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 791 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
785 if (gpu_info_.can_lose_context) | 792 if (gpu_info_.can_lose_context) |
786 return false; | 793 return false; |
787 #if defined(USE_SKIA) | 794 #if defined(USE_SKIA) |
788 return true; | 795 return true; |
789 #else | 796 #else |
790 return false; | 797 return false; |
791 #endif | 798 #endif |
792 } | 799 } |
793 | 800 |
OLD | NEW |