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

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

Issue 456513002: Add base:: qualification to some CommandLine references in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: imerge Created 6 years, 4 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 | Annotate | Revision Log
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 30 matching lines...) Expand all
41 41
42 struct GpuFeatureInfo { 42 struct GpuFeatureInfo {
43 std::string name; 43 std::string name;
44 bool blocked; 44 bool blocked;
45 bool disabled; 45 bool disabled;
46 std::string disabled_description; 46 std::string disabled_description;
47 bool fallback_to_software; 47 bool fallback_to_software;
48 }; 48 };
49 49
50 const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) { 50 const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
51 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 51 const base::CommandLine& command_line =
52 *base::CommandLine::ForCurrentProcess();
52 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); 53 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
53 54
54 const GpuFeatureInfo kGpuFeatureInfo[] = { 55 const GpuFeatureInfo kGpuFeatureInfo[] = {
55 { 56 {
56 "2d_canvas", 57 "2d_canvas",
57 manager->IsFeatureBlacklisted( 58 manager->IsFeatureBlacklisted(
58 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS), 59 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS),
59 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas) || 60 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas) ||
60 !GpuDataManagerImpl::GetInstance()-> 61 !GpuDataManagerImpl::GetInstance()->
61 GetGPUInfo().SupportsAccelerated2dCanvas(), 62 GetGPUInfo().SupportsAccelerated2dCanvas(),
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 157
157 }; 158 };
158 DCHECK(index < arraysize(kGpuFeatureInfo)); 159 DCHECK(index < arraysize(kGpuFeatureInfo));
159 *eof = (index == arraysize(kGpuFeatureInfo) - 1); 160 *eof = (index == arraysize(kGpuFeatureInfo) - 1);
160 return kGpuFeatureInfo[index]; 161 return kGpuFeatureInfo[index];
161 } 162 }
162 163
163 } // namespace 164 } // namespace
164 165
165 bool IsPinchVirtualViewportEnabled() { 166 bool IsPinchVirtualViewportEnabled() {
166 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 167 const base::CommandLine& command_line =
168 *base::CommandLine::ForCurrentProcess();
167 169
168 // Command line switches take precedence over platform default. 170 // Command line switches take precedence over platform default.
169 if (command_line.HasSwitch(cc::switches::kDisablePinchVirtualViewport)) 171 if (command_line.HasSwitch(cc::switches::kDisablePinchVirtualViewport))
170 return false; 172 return false;
171 if (command_line.HasSwitch(cc::switches::kEnablePinchVirtualViewport)) 173 if (command_line.HasSwitch(cc::switches::kEnablePinchVirtualViewport))
172 return true; 174 return true;
173 175
174 #if defined(OS_CHROMEOS) 176 #if defined(OS_CHROMEOS)
175 return true; 177 return true;
176 #else 178 #else
177 return false; 179 return false;
178 #endif 180 #endif
179 } 181 }
180 182
181 bool IsDelegatedRendererEnabled() { 183 bool IsDelegatedRendererEnabled() {
182 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 184 const base::CommandLine& command_line =
185 *base::CommandLine::ForCurrentProcess();
183 bool enabled = false; 186 bool enabled = false;
184 187
185 #if defined(USE_AURA) || defined(OS_MACOSX) 188 #if defined(USE_AURA) || defined(OS_MACOSX)
186 // Enable on Aura and Mac. 189 // Enable on Aura and Mac.
187 enabled = true; 190 enabled = true;
188 #endif 191 #endif
189 192
190 // Flags override. 193 // Flags override.
191 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer); 194 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer);
192 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer); 195 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer);
193 return enabled; 196 return enabled;
194 } 197 }
195 198
196 bool IsImplSidePaintingEnabled() { 199 bool IsImplSidePaintingEnabled() {
197 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 200 const base::CommandLine& command_line =
201 *base::CommandLine::ForCurrentProcess();
198 202
199 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) 203 if (command_line.HasSwitch(switches::kDisableImplSidePainting))
200 return false; 204 return false;
201 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) 205 else if (command_line.HasSwitch(switches::kEnableImplSidePainting))
202 return true; 206 return true;
203 else if (command_line.HasSwitch( 207 else if (command_line.HasSwitch(
204 switches::kEnableBleedingEdgeRenderingFastPaths)) 208 switches::kEnableBleedingEdgeRenderingFastPaths))
205 return true; 209 return true;
206 210
207 #if defined(OS_MACOSX) || defined(OS_WIN) 211 #if defined(OS_MACOSX) || defined(OS_WIN)
208 return false; 212 return false;
209 #else 213 #else
210 return true; 214 return true;
211 #endif 215 #endif
212 } 216 }
213 217
214 bool IsGpuRasterizationEnabled() { 218 bool IsGpuRasterizationEnabled() {
215 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 219 const base::CommandLine& command_line =
220 *base::CommandLine::ForCurrentProcess();
216 221
217 if (!IsImplSidePaintingEnabled()) 222 if (!IsImplSidePaintingEnabled())
218 return false; 223 return false;
219 224
220 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) 225 if (command_line.HasSwitch(switches::kDisableGpuRasterization))
221 return false; 226 return false;
222 else if (command_line.HasSwitch(switches::kEnableGpuRasterization)) 227 else if (command_line.HasSwitch(switches::kEnableGpuRasterization))
223 return true; 228 return true;
224 229
225 if (IsGpuRasterizationBlacklisted()) { 230 if (IsGpuRasterizationBlacklisted()) {
226 return false; 231 return false;
227 } 232 }
228 233
229 return true; 234 return true;
230 } 235 }
231 236
232 bool IsForceGpuRasterizationEnabled() { 237 bool IsForceGpuRasterizationEnabled() {
233 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 238 const base::CommandLine& command_line =
239 *base::CommandLine::ForCurrentProcess();
234 240
235 if (!IsImplSidePaintingEnabled()) 241 if (!IsImplSidePaintingEnabled())
236 return false; 242 return false;
237 243
238 return command_line.HasSwitch(switches::kForceGpuRasterization); 244 return command_line.HasSwitch(switches::kForceGpuRasterization);
239 } 245 }
240 246
241 base::Value* GetFeatureStatus() { 247 base::Value* GetFeatureStatus() {
242 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); 248 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
243 std::string gpu_access_blocked_reason; 249 std::string gpu_access_blocked_reason;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 return problem_list; 336 return problem_list;
331 } 337 }
332 338
333 base::Value* GetDriverBugWorkarounds() { 339 base::Value* GetDriverBugWorkarounds() {
334 base::ListValue* workaround_list = new base::ListValue(); 340 base::ListValue* workaround_list = new base::ListValue();
335 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list); 341 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list);
336 return workaround_list; 342 return workaround_list;
337 } 343 }
338 344
339 } // namespace content 345 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/gpu/gpu_data_manager_impl_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698