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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 776603003: Changed the GPU Tracer so the category names can be customized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Service side GPU trace not turned on when device is turned on Created 6 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 unified diff | Download patch
OLDNEW
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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h> 10 #include <GLES2/gl2extchromium.h>
(...skipping 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after
3470 length ? std::string(marker, length) : std::string(marker)); 3470 length ? std::string(marker, length) : std::string(marker));
3471 } 3471 }
3472 3472
3473 void GLES2Implementation::PopGroupMarkerEXT() { 3473 void GLES2Implementation::PopGroupMarkerEXT() {
3474 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3474 GPU_CLIENT_SINGLE_THREAD_CHECK();
3475 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()"); 3475 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()");
3476 helper_->PopGroupMarkerEXT(); 3476 helper_->PopGroupMarkerEXT();
3477 debug_marker_manager_.PopGroup(); 3477 debug_marker_manager_.PopGroup();
3478 } 3478 }
3479 3479
3480 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) { 3480 void GLES2Implementation::TraceBeginCHROMIUM(
3481 const char* category_name, const char* trace_name) {
3481 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3482 GPU_CLIENT_SINGLE_THREAD_CHECK();
3482 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM(" 3483 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM("
3483 << name << ")"); 3484 << category_name << ", " << trace_name << ")");
3484 if (current_trace_name_.get()) { 3485 if (current_trace_category_.get() || current_trace_name_.get()) {
3485 SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM", 3486 SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM",
3486 "trace already running"); 3487 "trace already running");
3487 return; 3488 return;
3488 } 3489 }
3489 TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this); 3490 TRACE_EVENT_COPY_ASYNC_BEGIN0(category_name, trace_name, this);
3490 SetBucketAsCString(kResultBucketId, name); 3491 SetBucketAsCString(kResultBucketId, category_name);
3491 helper_->TraceBeginCHROMIUM(kResultBucketId); 3492 SetBucketAsCString(kResultBucketId + 1, category_name);
3493 helper_->TraceBeginCHROMIUM(kResultBucketId, kResultBucketId + 1);
3492 helper_->SetBucketSize(kResultBucketId, 0); 3494 helper_->SetBucketSize(kResultBucketId, 0);
3493 current_trace_name_.reset(new std::string(name)); 3495 helper_->SetBucketSize(kResultBucketId + 1, 0);
3496 current_trace_category_.reset(new std::string(category_name));
3497 current_trace_name_.reset(new std::string(trace_name));
3494 } 3498 }
3495 3499
3496 void GLES2Implementation::TraceEndCHROMIUM() { 3500 void GLES2Implementation::TraceEndCHROMIUM() {
3497 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3501 GPU_CLIENT_SINGLE_THREAD_CHECK();
3498 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")"); 3502 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")");
3499 if (!current_trace_name_.get()) { 3503 if (!current_trace_category_.get() || !current_trace_name_.get()) {
3500 SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM", 3504 SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM",
3501 "missing begin trace"); 3505 "missing begin trace");
3502 return; 3506 return;
3503 } 3507 }
3504 helper_->TraceEndCHROMIUM(); 3508 helper_->TraceEndCHROMIUM();
3505 TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this); 3509 TRACE_EVENT_COPY_ASYNC_END0(current_trace_category_->c_str(),
3510 current_trace_name_->c_str(), this);
3511 current_trace_category_.reset();
3506 current_trace_name_.reset(); 3512 current_trace_name_.reset();
3507 } 3513 }
3508 3514
3509 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { 3515 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {
3510 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3516 GPU_CLIENT_SINGLE_THREAD_CHECK();
3511 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" 3517 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM("
3512 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); 3518 << target << ", " << GLES2Util::GetStringEnum(access) << ")");
3513 switch (target) { 3519 switch (target) {
3514 case GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM: 3520 case GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM:
3515 if (access != GL_READ_ONLY) { 3521 if (access != GL_READ_ONLY) {
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3972 return true; 3978 return true;
3973 } 3979 }
3974 3980
3975 // Include the auto-generated part of this file. We split this because it means 3981 // Include the auto-generated part of this file. We split this because it means
3976 // we can easily edit the non-auto generated parts right here in this file 3982 // we can easily edit the non-auto generated parts right here in this file
3977 // instead of having to edit some template or the code generator. 3983 // instead of having to edit some template or the code generator.
3978 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 3984 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
3979 3985
3980 } // namespace gles2 3986 } // namespace gles2
3981 } // namespace gpu 3987 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698