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

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: Update the autogen'd files. Created 7 years, 10 months 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gpu_trace.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c04d1e4fa6150c422a6ab85a478951ef6ba15cbb..09f73aee94f32aa45a0e990f5aedf5cad4f5d7df 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"
@@ -1707,7 +1707,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);
};
@@ -2169,6 +2169,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);
@@ -9877,24 +9879,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();
}
bool GLES2DecoderImpl::ValidateAsyncTransfer(
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gpu_trace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698