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 } | |
512 } | 506 } |
513 | 507 |
514 void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) { | 508 void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) { |
515 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 509 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
516 DCHECK(gpu_blacklist); | 510 DCHECK(gpu_blacklist); |
517 gpu_blacklist_.reset(gpu_blacklist); | 511 gpu_blacklist_.reset(gpu_blacklist); |
518 UpdateGpuFeatureFlags(); | 512 UpdateGpuFeatureFlags(); |
519 preliminary_gpu_feature_flags_ = gpu_feature_flags_; | 513 preliminary_gpu_feature_flags_ = gpu_feature_flags_; |
520 } | 514 } |
521 | 515 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 object->vendor_id != other.vendor_id) { | 729 object->vendor_id != other.vendor_id) { |
736 *object = other; | 730 *object = other; |
737 return true; | 731 return true; |
738 } | 732 } |
739 | 733 |
740 bool changed = false; | 734 bool changed = false; |
741 if (!object->finalized) { | 735 if (!object->finalized) { |
742 object->finalized = other.finalized; | 736 object->finalized = other.finalized; |
743 object->initialization_time = other.initialization_time; | 737 object->initialization_time = other.initialization_time; |
744 object->optimus |= other.optimus; | 738 object->optimus |= other.optimus; |
745 object->amd_switchable |= other.amd_switchable; | |
746 | 739 |
747 if (object->driver_vendor.empty()) { | 740 if (object->driver_vendor.empty()) { |
748 changed |= object->driver_vendor != other.driver_vendor; | 741 changed |= object->driver_vendor != other.driver_vendor; |
749 object->driver_vendor = other.driver_vendor; | 742 object->driver_vendor = other.driver_vendor; |
750 } | 743 } |
751 if (object->driver_version.empty()) { | 744 if (object->driver_version.empty()) { |
752 changed |= object->driver_version != other.driver_version; | 745 changed |= object->driver_version != other.driver_version; |
753 object->driver_version = other.driver_version; | 746 object->driver_version = other.driver_version; |
754 } | 747 } |
755 if (object->driver_date.empty()) { | 748 if (object->driver_date.empty()) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 792 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
800 if (gpu_info_.can_lose_context) | 793 if (gpu_info_.can_lose_context) |
801 return false; | 794 return false; |
802 #if defined(USE_SKIA) | 795 #if defined(USE_SKIA) |
803 return true; | 796 return true; |
804 #else | 797 #else |
805 return false; | 798 return false; |
806 #endif | 799 #endif |
807 } | 800 } |
808 | 801 |
OLD | NEW |