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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 if (command_line.HasSwitch(switches::kDisableThreadedGpuRasterization)) | 310 if (command_line.HasSwitch(switches::kDisableThreadedGpuRasterization)) |
311 return false; | 311 return false; |
312 | 312 |
313 return true; | 313 return true; |
314 } | 314 } |
315 | 315 |
316 bool UseSurfacesEnabled() { | 316 bool UseSurfacesEnabled() { |
317 #if defined(OS_ANDROID) | 317 #if defined(OS_ANDROID) |
318 return false; | 318 return false; |
319 #else | 319 #endif |
| 320 bool enabled = false; |
| 321 #if (defined(USE_AURA) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX) |
| 322 enabled = true; |
| 323 #endif |
| 324 |
320 const base::CommandLine& command_line = | 325 const base::CommandLine& command_line = |
321 *base::CommandLine::ForCurrentProcess(); | 326 *base::CommandLine::ForCurrentProcess(); |
322 | 327 |
323 return command_line.HasSwitch(switches::kUseSurfaces); | 328 // Flags override. |
324 #endif | 329 enabled |= command_line.HasSwitch(switches::kUseSurfaces); |
| 330 enabled &= !command_line.HasSwitch(switches::kDisableSurfaces); |
| 331 return enabled; |
325 } | 332 } |
326 | 333 |
327 int GpuRasterizationMSAASampleCount() { | 334 int GpuRasterizationMSAASampleCount() { |
328 const base::CommandLine& command_line = | 335 const base::CommandLine& command_line = |
329 *base::CommandLine::ForCurrentProcess(); | 336 *base::CommandLine::ForCurrentProcess(); |
330 | 337 |
331 if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) | 338 if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) |
332 return 0; | 339 return 0; |
333 std::string string_value = command_line.GetSwitchValueASCII( | 340 std::string string_value = command_line.GetSwitchValueASCII( |
334 switches::kGpuRasterizationMSAASampleCount); | 341 switches::kGpuRasterizationMSAASampleCount); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 } | 446 } |
440 } | 447 } |
441 return problem_list; | 448 return problem_list; |
442 } | 449 } |
443 | 450 |
444 std::vector<std::string> GetDriverBugWorkarounds() { | 451 std::vector<std::string> GetDriverBugWorkarounds() { |
445 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 452 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
446 } | 453 } |
447 | 454 |
448 } // namespace content | 455 } // namespace content |
OLD | NEW |