Index: content/gpu/gpu_main.cc |
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc |
index eeaa11b08c1cac214c37a6cb7c5a6bd02f216a54..8d8274945e66a58f36d770a7815990aa6961efc7 100644 |
--- a/content/gpu/gpu_main.cc |
+++ b/content/gpu/gpu_main.cc |
@@ -38,6 +38,7 @@ |
#include "base/win/scoped_com_initializer.h" |
#include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
#include "sandbox/win/src/sandbox.h" |
+#include "third_party/angle_dx11/src/common/event_tracer.h" |
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
#include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
@@ -79,6 +80,31 @@ bool GpuProcessLogMessageHandler(int severity, |
return false; |
} |
+const unsigned char* AngleGetTraceCategoryEnabledFlag(const char* name) { |
+ return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name); |
+} |
+ |
+void AngleAddTraceEvent(char phase, |
+ const unsigned char* category_group_enabled, |
+ const char* name, |
+ unsigned long long id, |
+ int num_args, |
+ const char** arg_names, |
+ const unsigned char* arg_types, |
+ const unsigned long long* arg_values, |
+ unsigned char flags) { |
+ TRACE_EVENT_API_ADD_TRACE_EVENT(phase, |
+ category_group_enabled, |
+ name, |
+ id, |
+ num_args, |
+ arg_names, |
+ arg_types, |
+ arg_values, |
+ NULL, |
+ flags); |
+} |
+ |
} // namespace anonymous |
// Main function for starting the Gpu process. |
@@ -87,6 +113,8 @@ int GpuMain(const MainFunctionParams& parameters) { |
base::debug::TraceLog::GetInstance()->SetProcessName("GPU Process"); |
base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
kTraceEventGpuProcessSortIndex); |
+ gl::SetTraceFunctionPointers(&AngleGetTraceCategoryEnabledFlag, |
apatrick_chromium
2013/08/12 19:34:13
Does this really work? ANGLE is dynamically loaded
|
+ &AngleAddTraceEvent); |
const CommandLine& command_line = parameters.command_line; |
if (command_line.HasSwitch(switches::kGpuStartupDialog)) { |