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 "chrome/browser/gpu_util.h" | 5 #include "chrome/browser/gpu_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "base/version.h" | 16 #include "base/version.h" |
| 17 #include "chrome/browser/chrome_browser_main.h" |
17 #include "chrome/browser/gpu_blacklist.h" | 18 #include "chrome/browser/gpu_blacklist.h" |
18 #include "content/public/browser/gpu_data_manager.h" | 19 #include "content/public/browser/gpu_data_manager.h" |
19 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
20 #include "content/public/common/gpu_info.h" | 21 #include "content/public/common/gpu_info.h" |
21 | 22 |
22 using content::GpuDataManager; | 23 using content::GpuDataManager; |
23 using content::GpuFeatureType; | 24 using content::GpuFeatureType; |
24 | 25 |
25 namespace { | 26 namespace { |
26 | 27 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 status = "enabled"; | 308 status = "enabled"; |
308 if (kGpuFeatureInfo[i].name == "webgl" && | 309 if (kGpuFeatureInfo[i].name == "webgl" && |
309 (command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || | 310 (command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || |
310 (flags & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))) | 311 (flags & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))) |
311 status += "_readback"; | 312 status += "_readback"; |
312 bool has_thread = CommandLine::ForCurrentProcess()->HasSwitch( | 313 bool has_thread = CommandLine::ForCurrentProcess()->HasSwitch( |
313 switches::kEnableThreadedCompositing) && | 314 switches::kEnableThreadedCompositing) && |
314 (!CommandLine::ForCurrentProcess()->HasSwitch( | 315 (!CommandLine::ForCurrentProcess()->HasSwitch( |
315 switches::kDisableThreadedCompositing)); | 316 switches::kDisableThreadedCompositing)); |
316 if (kGpuFeatureInfo[i].name == "compositing" && | 317 if (kGpuFeatureInfo[i].name == "compositing" && |
317 CommandLine::ForCurrentProcess()->HasSwitch( | 318 (CommandLine::ForCurrentProcess()->HasSwitch( |
318 switches::kForceCompositingMode)) | 319 switches::kForceCompositingMode) || |
| 320 chrome_browser_trials::g_in_force_compositing_mode_trial)) |
319 status += "_force"; | 321 status += "_force"; |
320 if (kGpuFeatureInfo[i].name == "compositing" && | 322 if (kGpuFeatureInfo[i].name == "compositing" && |
321 has_thread) | 323 has_thread) |
322 status += "_threaded"; | 324 status += "_threaded"; |
323 if (kGpuFeatureInfo[i].name == "css_animation") { | 325 if (kGpuFeatureInfo[i].name == "css_animation") { |
324 if (has_thread) | 326 if (has_thread) |
325 status = "accelerated_threaded"; | 327 status = "accelerated_threaded"; |
326 else | 328 else |
327 status = "accelerated"; | 329 status = "accelerated"; |
328 } | 330 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 kGpuBlacklistFeatureHistogramNamesWin[i], | 511 kGpuBlacklistFeatureHistogramNamesWin[i], |
510 1, kNumWinSubVersions * kGpuFeatureNumStatus, | 512 1, kNumWinSubVersions * kGpuFeatureNumStatus, |
511 kNumWinSubVersions * kGpuFeatureNumStatus + 1, | 513 kNumWinSubVersions * kGpuFeatureNumStatus + 1, |
512 base::Histogram::kUmaTargetedHistogramFlag); | 514 base::Histogram::kUmaTargetedHistogramFlag); |
513 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); | 515 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); |
514 #endif | 516 #endif |
515 } | 517 } |
516 } | 518 } |
517 | 519 |
518 } // namespace gpu_util; | 520 } // namespace gpu_util; |
OLD | NEW |