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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 " about:flags or the command line.", | 135 " about:flags or the command line.", |
142 true}, | 136 true}, |
143 {kMultipleRasterThreadsFeatureName, false, | 137 {kMultipleRasterThreadsFeatureName, false, |
144 NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.", | 138 NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.", |
145 false}, | 139 false}, |
146 {kNativeGpuMemoryBuffersFeatureName, false, | 140 {kNativeGpuMemoryBuffersFeatureName, false, |
147 !gpu::AreNativeGpuMemoryBuffersEnabled(), | 141 !gpu::AreNativeGpuMemoryBuffersEnabled(), |
148 "Native GpuMemoryBuffers have been disabled, either via about:flags" | 142 "Native GpuMemoryBuffers have been disabled, either via about:flags" |
149 " or command line.", | 143 " or command line.", |
150 true}, | 144 true}, |
151 {"vpx_decode", | |
152 manager->IsFeatureBlacklisted( | |
153 gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) || | |
154 manager->IsFeatureBlacklisted( | |
155 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), | |
156 accelerated_vpx_disabled, | |
157 "Accelerated VPx video decode has been disabled, either via blacklist" | |
158 " or the command line.", | |
159 true}, | |
160 {kWebGL2FeatureName, | 145 {kWebGL2FeatureName, |
161 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2), | 146 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2), |
162 command_line.HasSwitch(switches::kDisableES3APIs), | 147 command_line.HasSwitch(switches::kDisableES3APIs), |
163 "WebGL2 has been disabled via blacklist or the command line.", false}, | 148 "WebGL2 has been disabled via blacklist or the command line.", false}, |
164 }; | 149 }; |
165 DCHECK(index < arraysize(kGpuFeatureInfo)); | 150 DCHECK(index < arraysize(kGpuFeatureInfo)); |
166 *eof = (index == arraysize(kGpuFeatureInfo) - 1); | 151 *eof = (index == arraysize(kGpuFeatureInfo) - 1); |
167 return kGpuFeatureInfo[index]; | 152 return kGpuFeatureInfo[index]; |
168 } | 153 } |
169 | 154 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 384 } |
400 } | 385 } |
401 return problem_list; | 386 return problem_list; |
402 } | 387 } |
403 | 388 |
404 std::vector<std::string> GetDriverBugWorkarounds() { | 389 std::vector<std::string> GetDriverBugWorkarounds() { |
405 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 390 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
406 } | 391 } |
407 | 392 |
408 } // namespace content | 393 } // namespace content |
OLD | NEW |