| 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/compositor_util.h" | 5 #include "content/browser/gpu/compositor_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 std::string disabled_description; | 59 std::string disabled_description; |
| 60 bool fallback_to_software; | 60 bool fallback_to_software; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) { | 63 const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) { |
| 64 const base::CommandLine& command_line = | 64 const base::CommandLine& command_line = |
| 65 *base::CommandLine::ForCurrentProcess(); | 65 *base::CommandLine::ForCurrentProcess(); |
| 66 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); | 66 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); |
| 67 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); | 67 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); |
| 68 | 68 |
| 69 bool accelerated_vpx_disabled = | |
| 70 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode); | |
| 71 #if defined(OS_WIN) | |
| 72 accelerated_vpx_disabled |= !gpu_preferences.enable_accelerated_vpx_decode; | |
| 73 #endif | |
| 74 | |
| 75 const GpuFeatureInfo kGpuFeatureInfo[] = { | 69 const GpuFeatureInfo kGpuFeatureInfo[] = { |
| 76 {"2d_canvas", | 70 {"2d_canvas", |
| 77 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS), | 71 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS), |
| 78 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), | 72 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), |
| 79 "Accelerated 2D canvas is unavailable: either disabled via blacklist or" | 73 "Accelerated 2D canvas is unavailable: either disabled via blacklist or" |
| 80 " the command line.", | 74 " the command line.", |
| 81 true}, | 75 true}, |
| 82 {kGpuCompositingFeatureName, | 76 {kGpuCompositingFeatureName, |
| 83 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING), | 77 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING), |
| 84 command_line.HasSwitch(switches::kDisableGpuCompositing), | 78 command_line.HasSwitch(switches::kDisableGpuCompositing), |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 " about:flags or the command line.", | 134 " about:flags or the command line.", |
| 141 true}, | 135 true}, |
| 142 {kMultipleRasterThreadsFeatureName, false, | 136 {kMultipleRasterThreadsFeatureName, false, |
| 143 NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.", | 137 NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.", |
| 144 false}, | 138 false}, |
| 145 {kNativeGpuMemoryBuffersFeatureName, false, | 139 {kNativeGpuMemoryBuffersFeatureName, false, |
| 146 !gpu::AreNativeGpuMemoryBuffersEnabled(), | 140 !gpu::AreNativeGpuMemoryBuffersEnabled(), |
| 147 "Native GpuMemoryBuffers have been disabled, either via about:flags" | 141 "Native GpuMemoryBuffers have been disabled, either via about:flags" |
| 148 " or command line.", | 142 " or command line.", |
| 149 true}, | 143 true}, |
| 150 {"vpx_decode", manager->IsFeatureBlacklisted( | |
| 151 gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) || | |
| 152 manager->IsFeatureBlacklisted( | |
| 153 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), | |
| 154 accelerated_vpx_disabled, | |
| 155 "Accelerated VPx video decode has been disabled, either via blacklist" | |
| 156 " or the command line.", | |
| 157 true}, | |
| 158 {kWebGL2FeatureName, | 144 {kWebGL2FeatureName, |
| 159 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2), | 145 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2), |
| 160 command_line.HasSwitch(switches::kDisableES3APIs), | 146 command_line.HasSwitch(switches::kDisableES3APIs), |
| 161 "WebGL2 has been disabled via blacklist or the command line.", false}, | 147 "WebGL2 has been disabled via blacklist or the command line.", false}, |
| 162 }; | 148 }; |
| 163 DCHECK(index < arraysize(kGpuFeatureInfo)); | 149 DCHECK(index < arraysize(kGpuFeatureInfo)); |
| 164 *eof = (index == arraysize(kGpuFeatureInfo) - 1); | 150 *eof = (index == arraysize(kGpuFeatureInfo) - 1); |
| 165 return kGpuFeatureInfo[index]; | 151 return kGpuFeatureInfo[index]; |
| 166 } | 152 } |
| 167 | 153 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 399 } |
| 414 } | 400 } |
| 415 return problem_list; | 401 return problem_list; |
| 416 } | 402 } |
| 417 | 403 |
| 418 std::vector<std::string> GetDriverBugWorkarounds() { | 404 std::vector<std::string> GetDriverBugWorkarounds() { |
| 419 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 405 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
| 420 } | 406 } |
| 421 | 407 |
| 422 } // namespace content | 408 } // namespace content |
| OLD | NEW |