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

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

Powered by Google App Engine
This is Rietveld 408576698