| Index: gpu/command_buffer/service/gpu_tracer.cc
|
| diff --git a/gpu/command_buffer/service/gpu_tracer.cc b/gpu/command_buffer/service/gpu_tracer.cc
|
| index bbfcc09c1c24bb2aa61ff76dee3458c537db94b4..3ea2adee14d4f5aad444aedb8894858a71f282db 100644
|
| --- a/gpu/command_buffer/service/gpu_tracer.cc
|
| +++ b/gpu/command_buffer/service/gpu_tracer.cc
|
| @@ -24,7 +24,6 @@
|
| namespace gpu {
|
| namespace gles2 {
|
|
|
| -static const unsigned int kProcessInterval = 16;
|
| static const char* kGpuTraceSourceNames[] = {
|
| "TraceCHROMIUM", // kTraceCHROMIUM,
|
| "TraceCmd", // kTraceDecoder,
|
| @@ -251,7 +250,6 @@ bool GPUTracer::EndDecoding() {
|
| }
|
| }
|
| }
|
| - IssueProcessTask();
|
| }
|
|
|
| gpu_executing_ = false;
|
| @@ -297,7 +295,6 @@ bool GPUTracer::End(GpuTracerSource source) {
|
| }
|
|
|
| finished_traces_.push_back(trace);
|
| - IssueProcessTask();
|
| }
|
|
|
| markers_[source].pop_back();
|
| @@ -306,42 +303,8 @@ bool GPUTracer::End(GpuTracerSource source) {
|
| return false;
|
| }
|
|
|
| -bool GPUTracer::IsTracing() {
|
| - return (*gpu_trace_srv_category != 0) || (*gpu_trace_dev_category != 0);
|
| -}
|
| -
|
| -const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const {
|
| - if (source >= 0 &&
|
| - source < NUM_TRACER_SOURCES &&
|
| - !markers_[source].empty()) {
|
| - return markers_[source].back().category_;
|
| - }
|
| - return base::EmptyString();
|
| -}
|
| -
|
| -const std::string& GPUTracer::CurrentName(GpuTracerSource source) const {
|
| - if (source >= 0 &&
|
| - source < NUM_TRACER_SOURCES &&
|
| - !markers_[source].empty()) {
|
| - return markers_[source].back().name_;
|
| - }
|
| - return base::EmptyString();
|
| -}
|
| -
|
| -scoped_refptr<Outputter> GPUTracer::CreateOutputter(const std::string& name) {
|
| - return TraceOutputter::Create(name);
|
| -}
|
| -
|
| -void GPUTracer::PostTask() {
|
| - base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| - FROM_HERE, base::Bind(&GPUTracer::Process, base::AsWeakPtr(this)),
|
| - base::TimeDelta::FromMilliseconds(kProcessInterval));
|
| -}
|
| -
|
| -void GPUTracer::Process() {
|
| - process_posted_ = false;
|
| - ProcessTraces();
|
| - IssueProcessTask();
|
| +bool GPUTracer::HasTracesToProcess() {
|
| + return !finished_traces_.empty();
|
| }
|
|
|
| void GPUTracer::ProcessTraces() {
|
| @@ -386,6 +349,32 @@ void GPUTracer::ProcessTraces() {
|
| DCHECK(GL_NO_ERROR == glGetError());
|
| }
|
|
|
| +bool GPUTracer::IsTracing() {
|
| + return (*gpu_trace_srv_category != 0) || (*gpu_trace_dev_category != 0);
|
| +}
|
| +
|
| +const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const {
|
| + if (source >= 0 &&
|
| + source < NUM_TRACER_SOURCES &&
|
| + !markers_[source].empty()) {
|
| + return markers_[source].back().category_;
|
| + }
|
| + return base::EmptyString();
|
| +}
|
| +
|
| +const std::string& GPUTracer::CurrentName(GpuTracerSource source) const {
|
| + if (source >= 0 &&
|
| + source < NUM_TRACER_SOURCES &&
|
| + !markers_[source].empty()) {
|
| + return markers_[source].back().name_;
|
| + }
|
| + return base::EmptyString();
|
| +}
|
| +
|
| +scoped_refptr<Outputter> GPUTracer::CreateOutputter(const std::string& name) {
|
| + return TraceOutputter::Create(name);
|
| +}
|
| +
|
| bool GPUTracer::CheckDisjointStatus() {
|
| const int64 current_time = gpu_timing_client_->GetCurrentCPUTime();
|
| if (*gpu_trace_dev_category == 0)
|
| @@ -423,13 +412,5 @@ void GPUTracer::ClearOngoingTraces(bool have_context) {
|
| }
|
| }
|
|
|
| -void GPUTracer::IssueProcessTask() {
|
| - if (finished_traces_.empty() || process_posted_)
|
| - return;
|
| -
|
| - process_posted_ = true;
|
| - PostTask();
|
| -}
|
| -
|
| } // namespace gles2
|
| } // namespace gpu
|
|
|