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 "gpu/command_buffer/service/gpu_tracer.h" | 5 #include "gpu/command_buffer/service/gpu_tracer.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
18 #include "gpu/command_buffer/service/context_group.h" | 18 #include "gpu/command_buffer/service/context_group.h" |
19 #include "ui/gl/gl_bindings.h" | 19 #include "ui/gl/gl_bindings.h" |
20 #include "ui/gl/gl_context.h" | 20 #include "ui/gl/gl_context.h" |
21 #include "ui/gl/gl_version_info.h" | 21 #include "ui/gl/gl_version_info.h" |
22 #include "ui/gl/gpu_timing.h" | 22 #include "ui/gl/gpu_timing.h" |
23 | 23 |
24 namespace gpu { | 24 namespace gpu { |
25 namespace gles2 { | 25 namespace gles2 { |
26 | 26 |
27 static const unsigned int kProcessInterval = 16; | 27 static const unsigned int kProcessInterval = 16; |
28 static const char* kGpuTraceSourceNames[] = { | 28 static const char* kGpuTraceSourceNames[] = { |
29 "GroupMarker", // kTraceGroupMarker = 0, | 29 "TraceCHROMIUM", // kTraceCHROMIUM, |
30 "TraceCHROMIUM", // kTraceCHROMIUM = 1, | 30 "TraceCmd", // kTraceDecoder, |
31 "TraceCmd", // kTraceDecoder = 2, | 31 "Disjoint", // kTraceDisjoint, // Used internally. |
32 "Disjoint", // kTraceDisjoint = 3, // Used internally. | |
33 }; | 32 }; |
34 static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), | 33 static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), |
35 "Trace source names must match enumeration."); | 34 "Trace source names must match enumeration."); |
36 | 35 |
37 static TraceOutputter* g_outputter_thread = NULL; | 36 static TraceOutputter* g_outputter_thread = NULL; |
38 | 37 |
39 TraceMarker::TraceMarker(const std::string& category, const std::string& name) | 38 TraceMarker::TraceMarker(const std::string& category, const std::string& name) |
40 : category_(category), | 39 : category_(category), |
41 name_(name), | 40 name_(name), |
42 trace_(NULL) { | 41 trace_(NULL) { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 void GPUTracer::IssueProcessTask() { | 426 void GPUTracer::IssueProcessTask() { |
428 if (finished_traces_.empty() || process_posted_) | 427 if (finished_traces_.empty() || process_posted_) |
429 return; | 428 return; |
430 | 429 |
431 process_posted_ = true; | 430 process_posted_ = true; |
432 PostTask(); | 431 PostTask(); |
433 } | 432 } |
434 | 433 |
435 } // namespace gles2 | 434 } // namespace gles2 |
436 } // namespace gpu | 435 } // namespace gpu |
OLD | NEW |