Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 11416117: Hookup the GPUTrace events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correct method name. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 3fc39c6dda1c29f787f7a8648d00baa58d85d481..66739841c0d7485013cfdb3729514cc4b7bf94ed 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -40,7 +40,7 @@
#include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
#include "gpu/command_buffer/service/gles2_cmd_validation.h"
#include "gpu/command_buffer/service/gpu_switches.h"
-#include "gpu/command_buffer/service/gpu_trace.h"
+#include "gpu/command_buffer/service/gpu_tracer.h"
#include "gpu/command_buffer/service/image_manager.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/memory_tracking.h"
@@ -1671,7 +1671,7 @@ class GLES2DecoderImpl : public GLES2Decoder {
base::TimeDelta total_texture_upload_time_;
base::TimeDelta total_processing_commands_time_;
- std::stack<linked_ptr<GPUTrace> > gpu_trace_stack_;
+ scoped_ptr<GPUTracer> gpu_tracer_;
DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl);
};
@@ -2118,6 +2118,8 @@ bool GLES2DecoderImpl::Initialize(
DCHECK(context->IsCurrent(surface.get()));
DCHECK(!context_.get());
+ gpu_tracer_ = GPUTracer::Create();
+
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGPUDebugging)) {
set_debug(true);
@@ -6782,6 +6784,7 @@ error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM(
"glPostSubBufferCHROMIUM", "command not supported by surface");
return error::kNoError;
}
+
if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) {
return error::kNoError;
} else {
@@ -9646,24 +9649,23 @@ error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM(
if (!bucket->GetAsString(&command_name)) {
return error::kInvalidArguments;
}
-
- linked_ptr<GPUTrace> trace(new GPUTrace(command_name));
- trace->EnableStartTrace();
- gpu_trace_stack_.push(trace);
-
+ TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", command_name.c_str(), this);
+ if (!gpu_tracer_->Begin(command_name)) {
+ SetGLError(GL_INVALID_OPERATION,
+ "glTraceBeginCHROMIUM", "unable to create begin trace");
+ return error::kNoError;
+ }
return error::kNoError;
}
void GLES2DecoderImpl::DoTraceEndCHROMIUM() {
- if (gpu_trace_stack_.empty()) {
+ if (gpu_tracer_->CurrentName().empty()) {
SetGLError(GL_INVALID_OPERATION,
"glTraceEndCHROMIUM", "no trace begin found");
return;
}
-
- linked_ptr<GPUTrace> trace = gpu_trace_stack_.top();
- trace->EnableEndTrace();
- gpu_trace_stack_.pop();
+ TRACE_EVENT_COPY_ASYNC_END0("gpu", gpu_tracer_->CurrentName().c_str(), this);
+ gpu_tracer_->End();
}
error::Error GLES2DecoderImpl::HandleAsyncTexImage2DCHROMIUM(

Powered by Google App Engine
This is Rietveld 408576698