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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "gpu/config/gpu_info_collector.h" | 31 #include "gpu/config/gpu_info_collector.h" |
32 #include "ui/gl/gl_implementation.h" | 32 #include "ui/gl/gl_implementation.h" |
33 #include "ui/gl/gl_surface.h" | 33 #include "ui/gl/gl_surface.h" |
34 #include "ui/gl/gl_switches.h" | 34 #include "ui/gl/gl_switches.h" |
35 #include "ui/gl/gpu_switching_manager.h" | 35 #include "ui/gl/gpu_switching_manager.h" |
36 | 36 |
37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
38 #include "base/win/scoped_com_initializer.h" | 38 #include "base/win/scoped_com_initializer.h" |
39 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 39 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
40 #include "sandbox/win/src/sandbox.h" | 40 #include "sandbox/win/src/sandbox.h" |
41 #include "third_party/angle_dx11/src/common/event_tracer.h" | |
41 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) | 42 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
42 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" | 43 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
43 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) | 44 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
44 #include "content/common/gpu/media/vaapi_wrapper.h" | 45 #include "content/common/gpu/media/vaapi_wrapper.h" |
45 #endif | 46 #endif |
46 | 47 |
47 #if defined(USE_X11) | 48 #if defined(USE_X11) |
48 #include "ui/base/x/x11_util.h" | 49 #include "ui/base/x/x11_util.h" |
49 #endif | 50 #endif |
50 | 51 |
(...skipping 21 matching lines...) Expand all Loading... | |
72 const char* file, int line, | 73 const char* file, int line, |
73 size_t message_start, | 74 size_t message_start, |
74 const std::string& str) { | 75 const std::string& str) { |
75 std::string header = str.substr(0, message_start); | 76 std::string header = str.substr(0, message_start); |
76 std::string message = str.substr(message_start); | 77 std::string message = str.substr(message_start); |
77 deferred_messages.Get().push(new GpuHostMsg_OnLogMessage( | 78 deferred_messages.Get().push(new GpuHostMsg_OnLogMessage( |
78 severity, header, message)); | 79 severity, header, message)); |
79 return false; | 80 return false; |
80 } | 81 } |
81 | 82 |
83 const unsigned char* AngleGetTraceCategoryEnabledFlag(const char* name) { | |
84 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name); | |
85 } | |
86 | |
87 void AngleAddTraceEvent(char phase, | |
88 const unsigned char* category_group_enabled, | |
89 const char* name, | |
90 unsigned long long id, | |
91 int num_args, | |
92 const char** arg_names, | |
93 const unsigned char* arg_types, | |
94 const unsigned long long* arg_values, | |
95 unsigned char flags) { | |
96 TRACE_EVENT_API_ADD_TRACE_EVENT(phase, | |
97 category_group_enabled, | |
98 name, | |
99 id, | |
100 num_args, | |
101 arg_names, | |
102 arg_types, | |
103 arg_values, | |
104 NULL, | |
105 flags); | |
106 } | |
107 | |
82 } // namespace anonymous | 108 } // namespace anonymous |
83 | 109 |
84 // Main function for starting the Gpu process. | 110 // Main function for starting the Gpu process. |
85 int GpuMain(const MainFunctionParams& parameters) { | 111 int GpuMain(const MainFunctionParams& parameters) { |
86 TRACE_EVENT0("gpu", "GpuMain"); | 112 TRACE_EVENT0("gpu", "GpuMain"); |
87 base::debug::TraceLog::GetInstance()->SetProcessName("GPU Process"); | 113 base::debug::TraceLog::GetInstance()->SetProcessName("GPU Process"); |
88 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( | 114 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
89 kTraceEventGpuProcessSortIndex); | 115 kTraceEventGpuProcessSortIndex); |
116 gl::SetTraceFunctionPointers(&AngleGetTraceCategoryEnabledFlag, | |
apatrick_chromium
2013/08/12 19:34:13
Does this really work? ANGLE is dynamically loaded
| |
117 &AngleAddTraceEvent); | |
90 | 118 |
91 const CommandLine& command_line = parameters.command_line; | 119 const CommandLine& command_line = parameters.command_line; |
92 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { | 120 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { |
93 ChildProcess::WaitForDebugger("Gpu"); | 121 ChildProcess::WaitForDebugger("Gpu"); |
94 } | 122 } |
95 | 123 |
96 base::Time start_time = base::Time::Now(); | 124 base::Time start_time = base::Time::Now(); |
97 | 125 |
98 bool in_browser_process = command_line.HasSwitch(switches::kSingleProcess) || | 126 bool in_browser_process = command_line.HasSwitch(switches::kSingleProcess) || |
99 command_line.HasSwitch(switches::kInProcessGPU); | 127 command_line.HasSwitch(switches::kInProcessGPU); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 return true; | 454 return true; |
427 } | 455 } |
428 | 456 |
429 return false; | 457 return false; |
430 } | 458 } |
431 #endif // defined(OS_WIN) | 459 #endif // defined(OS_WIN) |
432 | 460 |
433 } // namespace. | 461 } // namespace. |
434 | 462 |
435 } // namespace content | 463 } // namespace content |
OLD | NEW |