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