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

Side by Side 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: Fixup TraceEnd test 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 unified diff | Download patch | Annotate | Revision Log
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 "../client/gles2_implementation.h" 7 #include "../client/gles2_implementation.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 3185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3196 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3196 GPU_CLIENT_SINGLE_THREAD_CHECK();
3197 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()"); 3197 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()");
3198 helper_->PopGroupMarkerEXT(); 3198 helper_->PopGroupMarkerEXT();
3199 debug_marker_manager_.PopGroup(); 3199 debug_marker_manager_.PopGroup();
3200 } 3200 }
3201 3201
3202 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) { 3202 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) {
3203 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3203 GPU_CLIENT_SINGLE_THREAD_CHECK();
3204 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM(" 3204 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM("
3205 << name << ")"); 3205 << name << ")");
3206 3206 if (current_trace_name_.get()) {
3207 SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM",
3208 "trace already running");
3209 return;
3210 }
3211 TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this);
3207 SetBucketAsCString(kResultBucketId, name); 3212 SetBucketAsCString(kResultBucketId, name);
3208 helper_->TraceBeginCHROMIUM(kResultBucketId); 3213 helper_->TraceBeginCHROMIUM(kResultBucketId);
3209 helper_->SetBucketSize(kResultBucketId, 0); 3214 helper_->SetBucketSize(kResultBucketId, 0);
3215 current_trace_name_.reset(new std::string(name));
3216 }
3217
3218 void GLES2Implementation::TraceEndCHROMIUM() {
3219 GPU_CLIENT_SINGLE_THREAD_CHECK();
3220 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")");
3221 if (!current_trace_name_.get()) {
3222 SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM",
3223 "missing begin trace");
3224 return;
3225 }
3226 helper_->TraceEndCHROMIUM();
3227 TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this);
3228 current_trace_name_.reset();
3210 } 3229 }
3211 3230
3212 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { 3231 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {
3213 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3232 GPU_CLIENT_SINGLE_THREAD_CHECK();
3214 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" 3233 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM("
3215 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); 3234 << target << ", " << GLES2Util::GetStringEnum(access) << ")");
3216 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { 3235 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) {
3217 SetGLError( 3236 SetGLError(
3218 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); 3237 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target");
3219 return NULL; 3238 return NULL;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3353 return; 3372 return;
3354 } 3373 }
3355 3374
3356 // Include the auto-generated part of this file. We split this because it means 3375 // Include the auto-generated part of this file. We split this because it means
3357 // we can easily edit the non-auto generated parts right here in this file 3376 // we can easily edit the non-auto generated parts right here in this file
3358 // instead of having to edit some template or the code generator. 3377 // instead of having to edit some template or the code generator.
3359 #include "../client/gles2_implementation_impl_autogen.h" 3378 #include "../client/gles2_implementation_impl_autogen.h"
3360 3379
3361 } // namespace gles2 3380 } // namespace gles2
3362 } // namespace gpu 3381 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698