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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 else if (command_line->HasSwitch(cc::switches::kEnableLCDText)) | 155 else if (command_line->HasSwitch(cc::switches::kEnableLCDText)) |
156 return true; | 156 return true; |
157 | 157 |
158 #if defined(OS_ANDROID) | 158 #if defined(OS_ANDROID) |
159 return false; | 159 return false; |
160 #else | 160 #else |
161 return true; | 161 return true; |
162 #endif | 162 #endif |
163 } | 163 } |
164 | 164 |
165 bool IsImplSidePaintingEnabled() { | 165 namespace { |
| 166 bool CheckImplSidePaintingStatus() { |
166 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 167 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
167 | 168 |
168 if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting)) | 169 if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting)) |
169 return false; | 170 return false; |
170 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) | 171 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) |
171 return true; | 172 return true; |
172 | 173 |
173 #if defined(OS_ANDROID) | 174 #if defined(OS_ANDROID) |
174 return true; | 175 return true; |
175 #else | 176 #else |
176 return false; | 177 return false; |
177 #endif | 178 #endif |
178 } | 179 } |
| 180 } // namespace |
| 181 |
| 182 bool IsImplSidePaintingEnabled() { |
| 183 static bool enabled = CheckImplSidePaintingStatus(); |
| 184 return enabled; |
| 185 } |
179 | 186 |
180 bool IsMapImageEnabled() { | 187 bool IsMapImageEnabled() { |
181 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 188 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
182 | 189 |
183 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) | 190 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) |
184 return false; | 191 return false; |
185 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) | 192 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) |
186 return true; | 193 return true; |
187 | 194 |
188 return false; | 195 return false; |
189 } | 196 } |
190 | 197 |
191 } // namespace switches | 198 } // namespace switches |
192 } // namespace cc | 199 } // namespace cc |
OLD | NEW |