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_version_info.h" | 20 #include "ui/gl/gl_version_info.h" |
21 #include "ui/gl/gpu_timing.h" | 21 #include "ui/gl/gpu_timing.h" |
22 | 22 |
23 namespace gpu { | 23 namespace gpu { |
24 namespace gles2 { | 24 namespace gles2 { |
25 | 25 |
26 static const unsigned int kProcessInterval = 16; | 26 static const unsigned int kProcessInterval = 16; |
27 static const char* kGpuTraceSourceNames[] = { | 27 static const char* kGpuTraceSourceNames[] = { |
28 "GroupMarker", // kTraceGroupMarker = 0, | 28 "TraceCHROMIUM", // kTraceCHROMIUM, |
29 "TraceCHROMIUM", // kTraceCHROMIUM = 1, | 29 "TraceCmd", // kTraceDecoder, |
30 "TraceCmd", // kTraceDecoder = 2, | 30 "Disjoint", // kTraceDisjoint, // Used internally. |
31 "Disjoint", // kTraceDisjoint = 3, // Used internally. | |
32 }; | 31 }; |
33 static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), | 32 static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), |
34 "Trace source names must match enumeration."); | 33 "Trace source names must match enumeration."); |
35 | 34 |
36 static TraceOutputter* g_outputter_thread = NULL; | 35 static TraceOutputter* g_outputter_thread = NULL; |
37 | 36 |
38 TraceMarker::TraceMarker(const std::string& category, const std::string& name) | 37 TraceMarker::TraceMarker(const std::string& category, const std::string& name) |
39 : category_(category), | 38 : category_(category), |
40 name_(name), | 39 name_(name), |
41 trace_(NULL) { | 40 trace_(NULL) { |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 void GPUTracer::IssueProcessTask() { | 427 void GPUTracer::IssueProcessTask() { |
429 if (finished_traces_.empty() || process_posted_) | 428 if (finished_traces_.empty() || process_posted_) |
430 return; | 429 return; |
431 | 430 |
432 process_posted_ = true; | 431 process_posted_ = true; |
433 PostTask(); | 432 PostTask(); |
434 } | 433 } |
435 | 434 |
436 } // namespace gles2 | 435 } // namespace gles2 |
437 } // namespace gpu | 436 } // namespace gpu |
OLD | NEW |