| 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/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/public/browser/gpu_data_manager.h" | 10 #include "content/public/browser/gpu_data_manager.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return base::win::GetVersion() >= base::win::VERSION_VISTA; | 105 return base::win::GetVersion() >= base::win::VERSION_VISTA; |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 return false; | 108 return false; |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool IsDelegatedRendererEnabled() { | 111 bool IsDelegatedRendererEnabled() { |
| 112 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 112 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 113 bool enabled = false; | 113 bool enabled = false; |
| 114 | 114 |
| 115 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | |
| 116 // Enable on non-ChromeOS Aura. Chrome OS has driver issues on some platforms: | |
| 117 // https://code.google.com/p/chrome-os-partner/issues/detail?id=22688 | |
| 118 enabled = true; | |
| 119 #endif | |
| 120 | |
| 121 // Flags override. | 115 // Flags override. |
| 122 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer); | 116 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer); |
| 123 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer); | 117 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer); |
| 124 | 118 |
| 125 // Needs compositing, and thread. | 119 // Needs compositing, and thread. |
| 126 if (enabled && | 120 if (enabled && |
| 127 (!IsForceCompositingModeEnabled() || !IsThreadedCompositingEnabled())) { | 121 (!IsForceCompositingModeEnabled() || !IsThreadedCompositingEnabled())) { |
| 128 enabled = false; | 122 enabled = false; |
| 129 LOG(ERROR) << "Disabling delegated-rendering because it needs " | 123 LOG(ERROR) << "Disabling delegated-rendering because it needs " |
| 130 << "force-compositing-mode and threaded-compositing."; | 124 << "force-compositing-mode and threaded-compositing."; |
| 131 } | 125 } |
| 132 | 126 |
| 133 return enabled; | 127 return enabled; |
| 134 } | 128 } |
| 135 | 129 |
| 136 bool IsDeadlineSchedulingEnabled() { | 130 bool IsDeadlineSchedulingEnabled() { |
| 137 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 131 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 138 | 132 |
| 139 // Default to disabled. | 133 // Default to disabled. |
| 140 bool enabled = false; | 134 bool enabled = false; |
| 141 | 135 |
| 142 // Flags override. | 136 // Flags override. |
| 143 enabled |= command_line.HasSwitch(switches::kEnableDeadlineScheduling); | 137 enabled |= command_line.HasSwitch(switches::kEnableDeadlineScheduling); |
| 144 enabled &= !command_line.HasSwitch(switches::kDisableDeadlineScheduling); | 138 enabled &= !command_line.HasSwitch(switches::kDisableDeadlineScheduling); |
| 145 | 139 |
| 146 return enabled; | 140 return enabled; |
| 147 } | 141 } |
| 148 | 142 |
| 149 } // namespace content | 143 } // namespace content |
| OLD | NEW |