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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 if (!IsImplSidePaintingEnabled()) | 281 if (!IsImplSidePaintingEnabled()) |
282 return false; | 282 return false; |
283 | 283 |
284 return command_line.HasSwitch(switches::kForceGpuRasterization); | 284 return command_line.HasSwitch(switches::kForceGpuRasterization); |
285 } | 285 } |
286 | 286 |
287 bool UseSurfacesEnabled() { | 287 bool UseSurfacesEnabled() { |
288 #if defined(OS_ANDROID) | 288 #if defined(OS_ANDROID) |
289 return false; | 289 return false; |
290 #endif | 290 #else |
291 bool enabled = false; | |
292 #if (defined(USE_AURA) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX) | |
293 enabled = true; | |
294 #endif | |
295 | |
296 const base::CommandLine& command_line = | 291 const base::CommandLine& command_line = |
297 *base::CommandLine::ForCurrentProcess(); | 292 *base::CommandLine::ForCurrentProcess(); |
298 | 293 |
299 // Flags override. | 294 return command_line.HasSwitch(switches::kUseSurfaces); |
300 enabled |= command_line.HasSwitch(switches::kUseSurfaces); | 295 #endif |
301 enabled &= !command_line.HasSwitch(switches::kDisableSurfaces); | |
302 return enabled; | |
303 } | 296 } |
304 | 297 |
305 base::DictionaryValue* GetFeatureStatus() { | 298 base::DictionaryValue* GetFeatureStatus() { |
306 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); | 299 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); |
307 std::string gpu_access_blocked_reason; | 300 std::string gpu_access_blocked_reason; |
308 bool gpu_access_blocked = | 301 bool gpu_access_blocked = |
309 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); | 302 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); |
310 | 303 |
311 base::DictionaryValue* feature_status_dict = new base::DictionaryValue(); | 304 base::DictionaryValue* feature_status_dict = new base::DictionaryValue(); |
312 | 305 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 } | 390 } |
398 } | 391 } |
399 return problem_list; | 392 return problem_list; |
400 } | 393 } |
401 | 394 |
402 std::vector<std::string> GetDriverBugWorkarounds() { | 395 std::vector<std::string> GetDriverBugWorkarounds() { |
403 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 396 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
404 } | 397 } |
405 | 398 |
406 } // namespace content | 399 } // namespace content |
OLD | NEW |