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/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
16 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 16 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
17 #include "gpu/command_buffer/service/context_group.h" | 17 #include "gpu/command_buffer/service/context_group.h" |
18 #include "ui/gl/gl_bindings.h" | 18 #include "ui/gl/gl_bindings.h" |
19 #include "ui/gl/gl_version_info.h" | 19 #include "ui/gl/gl_version_info.h" |
20 #include "ui/gl/gpu_timing.h" | 20 #include "ui/gl/gpu_timing.h" |
21 | 21 |
22 namespace gpu { | 22 namespace gpu { |
23 namespace gles2 { | 23 namespace gles2 { |
24 | 24 |
25 static const unsigned int kProcessInterval = 16; | 25 static const unsigned int kProcessInterval = 16; |
26 static const char* kGpuTraceSourceNames[] = { | 26 static const char* kGpuTraceSourceNames[] = { |
27 "GroupMarker", // kTraceGroupMarker = 0, | 27 "TraceCHROMIUM", // kTraceCHROMIUM = 0, |
28 "TraceCHROMIUM", // kTraceCHROMIUM = 1, | 28 "TraceCmd", // kTraceDecoder = 1, |
29 "TraceCmd", // kTraceDecoder = 2, | |
30 }; | 29 }; |
31 static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), | 30 static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), |
32 "Trace source names must match enumeration."); | 31 "Trace source names must match enumeration."); |
33 | 32 |
34 static TraceOutputter* g_outputter_thread = NULL; | 33 static TraceOutputter* g_outputter_thread = NULL; |
35 | 34 |
36 TraceMarker::TraceMarker(const std::string& category, const std::string& name) | 35 TraceMarker::TraceMarker(const std::string& category, const std::string& name) |
37 : category_(category), | 36 : category_(category), |
38 name_(name), | 37 name_(name), |
39 trace_(NULL) { | 38 trace_(NULL) { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 void GPUTracer::IssueProcessTask() { | 405 void GPUTracer::IssueProcessTask() { |
407 if (finished_traces_.empty() || process_posted_) | 406 if (finished_traces_.empty() || process_posted_) |
408 return; | 407 return; |
409 | 408 |
410 process_posted_ = true; | 409 process_posted_ = true; |
411 PostTask(); | 410 PostTask(); |
412 } | 411 } |
413 | 412 |
414 } // namespace gles2 | 413 } // namespace gles2 |
415 } // namespace gpu | 414 } // namespace gpu |
OLD | NEW |