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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 11416117: Hookup the GPUTrace events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index babf443c4663f3648cb11b9a8d7c9863f9360a2e..cc0bcae2d988d1dfd437cd717886e69cc5948621 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -3206,10 +3206,29 @@ void GLES2Implementation::TraceBeginCHROMIUM(const char* name) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM("
<< name << ")");
-
+ if (current_trace_name_.get()) {
+ SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM",
+ "trace already running");
+ return;
+ }
+ TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this);
SetBucketAsCString(kResultBucketId, name);
helper_->TraceBeginCHROMIUM(kResultBucketId);
helper_->SetBucketSize(kResultBucketId, 0);
+ current_trace_name_.reset(new std::string(name));
+}
+
+void GLES2Implementation::TraceEndCHROMIUM() {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")");
+ if (!current_trace_name_.get()) {
+ SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM",
+ "missing begin trace");
+ return;
+ }
+ helper_->TraceEndCHROMIUM();
+ TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this);
+ current_trace_name_.reset();
}
void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {

Powered by Google App Engine
This is Rietveld 408576698