| 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 "cc/base/switches.h" | 5 #include "cc/base/switches.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 namespace switches { | 10 namespace switches { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return true; | 164 return true; |
| 165 | 165 |
| 166 #if defined(OS_ANDROID) | 166 #if defined(OS_ANDROID) |
| 167 return false; | 167 return false; |
| 168 #else | 168 #else |
| 169 return true; | 169 return true; |
| 170 #endif | 170 #endif |
| 171 } | 171 } |
| 172 | 172 |
| 173 namespace { | 173 namespace { |
| 174 |
| 174 bool CheckImplSidePaintingStatus() { | 175 bool CheckImplSidePaintingStatus() { |
| 175 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 176 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 176 | 177 |
| 177 if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting)) | 178 if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting)) |
| 178 return false; | 179 return false; |
| 179 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) | 180 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) |
| 180 return true; | 181 return true; |
| 181 | 182 |
| 182 #if defined(OS_ANDROID) | 183 #if defined(OS_ANDROID) |
| 183 return true; | 184 return true; |
| 184 #else | 185 #else |
| 185 return false; | 186 return false; |
| 186 #endif | 187 #endif |
| 187 } | 188 } |
| 189 |
| 190 bool CheckGPURasterizationStatus() { |
| 191 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 192 return command_line.HasSwitch(cc::switches::kEnableGPURasterization); |
| 193 } |
| 194 |
| 188 } // namespace | 195 } // namespace |
| 189 | 196 |
| 190 bool IsImplSidePaintingEnabled() { | 197 bool IsImplSidePaintingEnabled() { |
| 191 static bool enabled = CheckImplSidePaintingStatus(); | 198 static bool enabled = CheckImplSidePaintingStatus(); |
| 192 return enabled; | 199 return enabled; |
| 193 } | 200 } |
| 194 | 201 |
| 195 bool IsGPURasterizationEnabled() { | 202 bool IsGPURasterizationEnabled() { |
| 196 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 203 static bool enabled = CheckGPURasterizationStatus(); |
| 197 return command_line.HasSwitch(cc::switches::kEnableGPURasterization); | 204 return enabled; |
| 198 } | 205 } |
| 199 | 206 |
| 200 bool IsMapImageEnabled() { | 207 bool IsMapImageEnabled() { |
| 201 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 208 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 202 | 209 |
| 203 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) | 210 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) |
| 204 return false; | 211 return false; |
| 205 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) | 212 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) |
| 206 return true; | 213 return true; |
| 207 | 214 |
| 208 return false; | 215 return false; |
| 209 } | 216 } |
| 210 | 217 |
| 211 } // namespace switches | 218 } // namespace switches |
| 212 } // namespace cc | 219 } // namespace cc |
| OLD | NEW |