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 "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 "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 return false; | 303 return false; |
304 if (command_line.HasSwitch(switches::kEnableThreadedGpuRasterization)) | 304 if (command_line.HasSwitch(switches::kEnableThreadedGpuRasterization)) |
305 return true; | 305 return true; |
306 | 306 |
307 return false; | 307 return false; |
308 } | 308 } |
309 | 309 |
310 bool UseSurfacesEnabled() { | 310 bool UseSurfacesEnabled() { |
311 #if defined(OS_ANDROID) | 311 #if defined(OS_ANDROID) |
312 return false; | 312 return false; |
313 #endif | 313 #else |
314 bool enabled = false; | |
315 #if (defined(USE_AURA) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX) | |
316 enabled = true; | |
317 #endif | |
318 | |
319 const base::CommandLine& command_line = | 314 const base::CommandLine& command_line = |
320 *base::CommandLine::ForCurrentProcess(); | 315 *base::CommandLine::ForCurrentProcess(); |
321 | 316 |
322 // Flags override. | 317 return command_line.HasSwitch(switches::kUseSurfaces); |
323 enabled |= command_line.HasSwitch(switches::kUseSurfaces); | 318 #endif |
324 enabled &= !command_line.HasSwitch(switches::kDisableSurfaces); | |
325 return enabled; | |
326 } | 319 } |
327 | 320 |
328 int GpuRasterizationMSAASampleCount() { | 321 int GpuRasterizationMSAASampleCount() { |
329 const base::CommandLine& command_line = | 322 const base::CommandLine& command_line = |
330 *base::CommandLine::ForCurrentProcess(); | 323 *base::CommandLine::ForCurrentProcess(); |
331 | 324 |
332 if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) | 325 if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) |
333 return 0; | 326 return 0; |
334 std::string string_value = command_line.GetSwitchValueASCII( | 327 std::string string_value = command_line.GetSwitchValueASCII( |
335 switches::kGpuRasterizationMSAASampleCount); | 328 switches::kGpuRasterizationMSAASampleCount); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } | 433 } |
441 } | 434 } |
442 return problem_list; | 435 return problem_list; |
443 } | 436 } |
444 | 437 |
445 std::vector<std::string> GetDriverBugWorkarounds() { | 438 std::vector<std::string> GetDriverBugWorkarounds() { |
446 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 439 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
447 } | 440 } |
448 | 441 |
449 } // namespace content | 442 } // namespace content |
OLD | NEW |