Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: content/browser/gpu/compositor_util.cc

Issue 2737983002: WebGL feature will only enabled when accelerated (Closed)
Patch Set: Formatting fix Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 "Accelerated 2D canvas is unavailable: either disabled via blacklist or" 79 "Accelerated 2D canvas is unavailable: either disabled via blacklist or"
80 " the command line.", 80 " the command line.",
81 true}, 81 true},
82 {kGpuCompositingFeatureName, 82 {kGpuCompositingFeatureName,
83 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING), 83 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING),
84 command_line.HasSwitch(switches::kDisableGpuCompositing), 84 command_line.HasSwitch(switches::kDisableGpuCompositing),
85 "Gpu compositing has been disabled, either via blacklist, about:flags" 85 "Gpu compositing has been disabled, either via blacklist, about:flags"
86 " or the command line. The browser will fall back to software compositing" 86 " or the command line. The browser will fall back to software compositing"
87 " and hardware acceleration will be unavailable.", 87 " and hardware acceleration will be unavailable.",
88 true}, 88 true},
89 {kWebGLFeatureName, 89 {kWebGLFeatureName, !manager->IsWebGLEnabled(),
90 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL),
91 command_line.HasSwitch(switches::kDisableExperimentalWebGL), 90 command_line.HasSwitch(switches::kDisableExperimentalWebGL),
92 "WebGL has been disabled via blacklist or the command line.", false}, 91 "WebGL has been disabled via blacklist or the command line.", false},
93 {"flash_3d", manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D), 92 {"flash_3d", manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D),
94 command_line.HasSwitch(switches::kDisableFlash3d), 93 command_line.HasSwitch(switches::kDisableFlash3d),
95 "Using 3d in flash has been disabled, either via blacklist, about:flags or" 94 "Using 3d in flash has been disabled, either via blacklist, about:flags or"
96 " the command line.", 95 " the command line.",
97 true}, 96 true},
98 {"flash_stage3d", 97 {"flash_stage3d",
99 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D), 98 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D),
100 command_line.HasSwitch(switches::kDisableFlashStage3d), 99 command_line.HasSwitch(switches::kDisableFlashStage3d),
101 "Using Stage3d in Flash has been disabled, either via blacklist," 100 "Using Stage3d in Flash has been disabled, either via blacklist,"
102 " about:flags or the command line.", 101 " about:flags or the command line.",
103 true}, 102 true},
104 {"flash_stage3d_baseline", 103 {"flash_stage3d_baseline",
105 manager->IsFeatureBlacklisted( 104 manager->IsFeatureBlacklisted(
106 gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) || 105 gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) ||
107 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D), 106 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D),
108 command_line.HasSwitch(switches::kDisableFlashStage3d), 107 command_line.HasSwitch(switches::kDisableFlashStage3d),
109 "Using Stage3d Baseline profile in Flash has been disabled, either" 108 "Using Stage3d Baseline profile in Flash has been disabled, either"
110 " via blacklist, about:flags or the command line.", 109 " via blacklist, about:flags or the command line.",
111 true}, 110 true},
112 {"video_decode", manager->IsFeatureBlacklisted( 111 {"video_decode",
113 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), 112 manager->IsFeatureBlacklisted(
113 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
114 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), 114 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
115 "Accelerated video decode has been disabled, either via blacklist," 115 "Accelerated video decode has been disabled, either via blacklist,"
116 " about:flags or the command line.", 116 " about:flags or the command line.",
117 true}, 117 true},
118 #if BUILDFLAG(ENABLE_WEBRTC) 118 #if BUILDFLAG(ENABLE_WEBRTC)
119 {"video_encode", manager->IsFeatureBlacklisted( 119 {"video_encode",
120 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE), 120 manager->IsFeatureBlacklisted(
121 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE),
121 command_line.HasSwitch(switches::kDisableWebRtcHWEncoding), 122 command_line.HasSwitch(switches::kDisableWebRtcHWEncoding),
122 "Accelerated video encode has been disabled, either via blacklist," 123 "Accelerated video encode has been disabled, either via blacklist,"
123 " about:flags or the command line.", 124 " about:flags or the command line.",
124 true}, 125 true},
125 #endif 126 #endif
126 #if defined(OS_CHROMEOS) 127 #if defined(OS_CHROMEOS)
127 {"panel_fitting", 128 {"panel_fitting",
128 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_PANEL_FITTING), 129 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_PANEL_FITTING),
129 command_line.HasSwitch(switches::kDisablePanelFitting), 130 command_line.HasSwitch(switches::kDisablePanelFitting),
130 "Panel fitting has been disabled, either via blacklist, about:flags or" 131 "Panel fitting has been disabled, either via blacklist, about:flags or"
131 " the command line.", 132 " the command line.",
132 false}, 133 false},
133 #endif 134 #endif
134 {kRasterizationFeatureName, 135 {kRasterizationFeatureName,
135 IsGpuRasterizationBlacklisted() && !IsGpuRasterizationEnabled() && 136 IsGpuRasterizationBlacklisted() && !IsGpuRasterizationEnabled() &&
136 !IsForceGpuRasterizationEnabled(), 137 !IsForceGpuRasterizationEnabled(),
137 !IsGpuRasterizationEnabled() && !IsForceGpuRasterizationEnabled() && 138 !IsGpuRasterizationEnabled() && !IsForceGpuRasterizationEnabled() &&
138 !IsGpuRasterizationBlacklisted(), 139 !IsGpuRasterizationBlacklisted(),
139 "Accelerated rasterization has been disabled, either via blacklist," 140 "Accelerated rasterization has been disabled, either via blacklist,"
140 " about:flags or the command line.", 141 " about:flags or the command line.",
141 true}, 142 true},
142 {kMultipleRasterThreadsFeatureName, false, 143 {kMultipleRasterThreadsFeatureName, false,
143 NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.", 144 NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.",
144 false}, 145 false},
145 {kNativeGpuMemoryBuffersFeatureName, false, 146 {kNativeGpuMemoryBuffersFeatureName, false,
146 !gpu::AreNativeGpuMemoryBuffersEnabled(), 147 !gpu::AreNativeGpuMemoryBuffersEnabled(),
147 "Native GpuMemoryBuffers have been disabled, either via about:flags" 148 "Native GpuMemoryBuffers have been disabled, either via about:flags"
148 " or command line.", 149 " or command line.",
149 true}, 150 true},
150 {"vpx_decode", manager->IsFeatureBlacklisted( 151 {"vpx_decode",
151 gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) || 152 manager->IsFeatureBlacklisted(
152 manager->IsFeatureBlacklisted( 153 gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) ||
153 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), 154 manager->IsFeatureBlacklisted(
155 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
154 accelerated_vpx_disabled, 156 accelerated_vpx_disabled,
155 "Accelerated VPx video decode has been disabled, either via blacklist" 157 "Accelerated VPx video decode has been disabled, either via blacklist"
156 " or the command line.", 158 " or the command line.",
157 true}, 159 true},
158 {kWebGL2FeatureName, 160 {kWebGL2FeatureName,
159 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2), 161 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2),
160 command_line.HasSwitch(switches::kDisableES3APIs), 162 command_line.HasSwitch(switches::kDisableES3APIs),
161 "WebGL2 has been disabled via blacklist or the command line.", false}, 163 "WebGL2 has been disabled via blacklist or the command line.", false},
162 }; 164 };
163 DCHECK(index < arraysize(kGpuFeatureInfo)); 165 DCHECK(index < arraysize(kGpuFeatureInfo));
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 402 }
401 } 403 }
402 return problem_list; 404 return problem_list;
403 } 405 }
404 406
405 std::vector<std::string> GetDriverBugWorkarounds() { 407 std::vector<std::string> GetDriverBugWorkarounds() {
406 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 408 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
407 } 409 }
408 410
409 } // namespace content 411 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/extensions/requirements_checker_browsertest.cc ('k') | content/browser/gpu/gpu_data_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698