| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING, | 148 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING, |
| 149 gpu::GPU_FEATURE_TYPE_WEBGL | 149 gpu::GPU_FEATURE_TYPE_WEBGL |
| 150 }; | 150 }; |
| 151 const std::string kGpuBlacklistFeatureHistogramNames[] = { | 151 const std::string kGpuBlacklistFeatureHistogramNames[] = { |
| 152 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", | 152 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", |
| 153 "GPU.BlacklistFeatureTestResults.AcceleratedCompositing", | 153 "GPU.BlacklistFeatureTestResults.AcceleratedCompositing", |
| 154 "GPU.BlacklistFeatureTestResults.Webgl", | 154 "GPU.BlacklistFeatureTestResults.Webgl", |
| 155 }; | 155 }; |
| 156 const bool kGpuFeatureUserFlags[] = { | 156 const bool kGpuFeatureUserFlags[] = { |
| 157 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), | 157 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), |
| 158 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), | 158 false, |
| 159 command_line.HasSwitch(switches::kDisableExperimentalWebGL), | 159 command_line.HasSwitch(switches::kDisableExperimentalWebGL), |
| 160 }; | 160 }; |
| 161 #if defined(OS_WIN) | 161 #if defined(OS_WIN) |
| 162 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { | 162 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { |
| 163 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", | 163 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", |
| 164 "GPU.BlacklistFeatureTestResultsWindows.AcceleratedCompositing", | 164 "GPU.BlacklistFeatureTestResultsWindows.AcceleratedCompositing", |
| 165 "GPU.BlacklistFeatureTestResultsWindows.Webgl", | 165 "GPU.BlacklistFeatureTestResultsWindows.Webgl", |
| 166 }; | 166 }; |
| 167 #endif | 167 #endif |
| 168 const size_t kNumFeatures = | 168 const size_t kNumFeatures = |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 634 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
| 635 GpuDataManagerImpl::UnlockedSession session(owner_); | 635 GpuDataManagerImpl::UnlockedSession session(owner_); |
| 636 observer_list_->Notify(&GpuDataManagerObserver::OnVideoMemoryUsageStatsUpdate, | 636 observer_list_->Notify(&GpuDataManagerObserver::OnVideoMemoryUsageStatsUpdate, |
| 637 video_memory_usage_stats); | 637 video_memory_usage_stats); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void GpuDataManagerImplPrivate::AppendRendererCommandLine( | 640 void GpuDataManagerImplPrivate::AppendRendererCommandLine( |
| 641 CommandLine* command_line) const { | 641 CommandLine* command_line) const { |
| 642 DCHECK(command_line); | 642 DCHECK(command_line); |
| 643 | 643 |
| 644 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) && | |
| 645 !command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) | |
| 646 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | |
| 647 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && | 644 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && |
| 648 !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) | 645 !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
| 649 command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); | 646 command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); |
| 650 #if defined(ENABLE_WEBRTC) | 647 #if defined(ENABLE_WEBRTC) |
| 651 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | 648 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
| 652 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | 649 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) |
| 653 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | 650 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); |
| 654 #endif | 651 #endif |
| 655 | 652 |
| 656 if (use_software_compositor_ && | 653 if (use_software_compositor_ && |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 } | 727 } |
| 731 | 728 |
| 732 void GpuDataManagerImplPrivate::AppendPluginCommandLine( | 729 void GpuDataManagerImplPrivate::AppendPluginCommandLine( |
| 733 CommandLine* command_line) const { | 730 CommandLine* command_line) const { |
| 734 DCHECK(command_line); | 731 DCHECK(command_line); |
| 735 | 732 |
| 736 #if defined(OS_MACOSX) | 733 #if defined(OS_MACOSX) |
| 737 // TODO(jbauman): Add proper blacklist support for core animation plugins so | 734 // TODO(jbauman): Add proper blacklist support for core animation plugins so |
| 738 // special-casing this video card won't be necessary. See | 735 // special-casing this video card won't be necessary. See |
| 739 // http://crbug.com/134015 | 736 // http://crbug.com/134015 |
| 740 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || | 737 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING)) { |
| 741 CommandLine::ForCurrentProcess()->HasSwitch( | |
| 742 switches::kDisableAcceleratedCompositing)) { | |
| 743 if (!command_line->HasSwitch( | 738 if (!command_line->HasSwitch( |
| 744 switches::kDisableCoreAnimationPlugins)) | 739 switches::kDisableCoreAnimationPlugins)) |
| 745 command_line->AppendSwitch( | 740 command_line->AppendSwitch( |
| 746 switches::kDisableCoreAnimationPlugins); | 741 switches::kDisableCoreAnimationPlugins); |
| 747 } | 742 } |
| 748 #endif | 743 #endif |
| 749 } | 744 } |
| 750 | 745 |
| 751 void GpuDataManagerImplPrivate::UpdateRendererWebPrefs( | 746 void GpuDataManagerImplPrivate::UpdateRendererWebPrefs( |
| 752 WebPreferences* prefs) const { | 747 WebPreferences* prefs) const { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 update_histograms_(true), | 966 update_histograms_(true), |
| 972 window_count_(0), | 967 window_count_(0), |
| 973 domain_blocking_enabled_(true), | 968 domain_blocking_enabled_(true), |
| 974 owner_(owner), | 969 owner_(owner), |
| 975 display_count_(0), | 970 display_count_(0), |
| 976 gpu_process_accessible_(true), | 971 gpu_process_accessible_(true), |
| 977 use_software_compositor_(false), | 972 use_software_compositor_(false), |
| 978 finalized_(false) { | 973 finalized_(false) { |
| 979 DCHECK(owner_); | 974 DCHECK(owner_); |
| 980 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 975 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 981 if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { | |
| 982 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); | |
| 983 command_line->AppendSwitch(switches::kDisableAcceleratedLayers); | |
| 984 } | |
| 985 if (command_line->HasSwitch(switches::kDisableGpu)) | 976 if (command_line->HasSwitch(switches::kDisableGpu)) |
| 986 DisableHardwareAcceleration(); | 977 DisableHardwareAcceleration(); |
| 987 if (command_line->HasSwitch(switches::kEnableSoftwareCompositing)) | 978 if (command_line->HasSwitch(switches::kEnableSoftwareCompositing)) |
| 988 use_software_compositor_ = true; | 979 use_software_compositor_ = true; |
| 989 #if defined(USE_AURA) || defined(OS_MACOSX) | 980 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 990 use_software_compositor_ = true; | 981 use_software_compositor_ = true; |
| 991 #endif | 982 #endif |
| 992 | 983 |
| 993 #if defined(OS_MACOSX) | 984 #if defined(OS_MACOSX) |
| 994 CGGetActiveDisplayList (0, NULL, &display_count_); | 985 CGGetActiveDisplayList (0, NULL, &display_count_); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 | 1191 |
| 1201 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1192 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
| 1202 gpu_process_accessible_ = false; | 1193 gpu_process_accessible_ = false; |
| 1203 gpu_info_.finalized = true; | 1194 gpu_info_.finalized = true; |
| 1204 complete_gpu_info_already_requested_ = true; | 1195 complete_gpu_info_already_requested_ = true; |
| 1205 // Some observers might be waiting. | 1196 // Some observers might be waiting. |
| 1206 NotifyGpuInfoUpdate(); | 1197 NotifyGpuInfoUpdate(); |
| 1207 } | 1198 } |
| 1208 | 1199 |
| 1209 } // namespace content | 1200 } // namespace content |
| OLD | NEW |