summaryrefslogtreecommitdiffstats
path: root/content/gpu
diff options
context:
space:
mode:
authorjmadill <jmadill@chromium.org>2015-03-18 15:45:22 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-18 22:45:58 +0000
commit29fda863e960afecd39be697b54506877264a30f (patch)
tree2b7af6b24dcf2436b1204a8976fac7838a314046 /content/gpu
parentf4a0d6b3eb666ef634d719e4d5ddc0dee3bb0d12 (diff)
downloadchromium_src-29fda863e960afecd39be697b54506877264a30f.zip
chromium_src-29fda863e960afecd39be697b54506877264a30f.tar.gz
chromium_src-29fda863e960afecd39be697b54506877264a30f.tar.bz2
Add ANGLE Platform implementation.
*re-re-land with SwiftShader fix* *re-land with fix to components_browsertests* This logic allows us to record traces and histograms easily within ANGLE's code. It also gives a flexible design that we can extend with further methods later, without breaking compilation. The design is based on blink::Platform. Also add two new histogram descriptions to histograms.xml, and move the GPU Process metrics init to before InitializeOneOff, so ANGLE can record histograms during Renderer initialization. BUG=436191 TBR=jam@chromium.org, asvitkine@chromium.org, piman@chromium.org, maruel@chromium.org, kbr@chromium.org Review URL: https://codereview.chromium.org/1007513006 Cr-Commit-Position: refs/heads/master@{#321225}
Diffstat (limited to 'content/gpu')
-rw-r--r--content/gpu/gpu_main.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index b34d42f..76a6020 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -12,6 +12,7 @@
#include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/statistics_recorder.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -214,14 +215,14 @@ int GpuMain(const MainFunctionParams& parameters) {
watchdog_thread->StartWithOptions(options);
}
+ // Initializes StatisticsRecorder which tracks UMA histograms.
+ base::StatisticsRecorder::Initialize();
+
gpu::GPUInfo gpu_info;
// Get vendor_id, device_id, driver_version from browser process through
// commandline switches.
GetGpuInfoFromCommandLine(gpu_info, command_line);
- base::TimeDelta collect_context_time;
- base::TimeDelta initialize_one_off_time;
-
// Warm up resources that don't need access to GPUInfo.
if (WarmUpSandbox(command_line)) {
#if defined(OS_LINUX)
@@ -293,15 +294,18 @@ int GpuMain(const MainFunctionParams& parameters) {
#endif // !defined(OS_CHROMEOS)
#endif // defined(OS_LINUX)
#endif // !defined(OS_MACOSX)
- collect_context_time =
+ base::TimeDelta collect_context_time =
base::TimeTicks::Now() - before_collect_context_graphics_info;
+ UMA_HISTOGRAM_TIMES("GPU.CollectContextGraphicsInfo",
+ collect_context_time);
} else { // gl_initialized
VLOG(1) << "gfx::GLSurface::InitializeOneOff failed";
dead_on_arrival = true;
}
- initialize_one_off_time =
+ base::TimeDelta initialize_one_off_time =
base::TimeTicks::Now() - before_initialize_one_off;
+ UMA_HISTOGRAM_TIMES("GPU.InitializeOneOffTime", initialize_one_off_time);
if (enable_watchdog && delayed_watchdog_enable) {
watchdog_thread = new GpuWatchdogThread(kGpuTimeout);
@@ -342,11 +346,6 @@ int GpuMain(const MainFunctionParams& parameters) {
GpuProcess gpu_process;
- // These UMA must be stored after GpuProcess is constructed as it
- // initializes StatisticsRecorder which tracks the histograms.
- UMA_HISTOGRAM_TIMES("GPU.CollectContextGraphicsInfo", collect_context_time);
- UMA_HISTOGRAM_TIMES("GPU.InitializeOneOffTime", initialize_one_off_time);
-
GpuChildThread* child_thread = new GpuChildThread(watchdog_thread.get(),
dead_on_arrival,
gpu_info,