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

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: 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 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 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3263 GPU_CLIENT_SINGLE_THREAD_CHECK();
3264 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()"); 3264 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()");
3265 helper_->PopGroupMarkerEXT(); 3265 helper_->PopGroupMarkerEXT();
3266 debug_marker_manager_.PopGroup(); 3266 debug_marker_manager_.PopGroup();
3267 } 3267 }
3268 3268
3269 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) { 3269 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) {
3270 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3270 GPU_CLIENT_SINGLE_THREAD_CHECK();
3271 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM(" 3271 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM("
3272 << name << ")"); 3272 << name << ")");
3273 3273 if (current_trace_name_.get()) {
3274 SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM",
3275 "trace already running");
3276 return;
3277 }
3278 TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this);
3274 SetBucketAsCString(kResultBucketId, name); 3279 SetBucketAsCString(kResultBucketId, name);
3275 helper_->TraceBeginCHROMIUM(kResultBucketId); 3280 helper_->TraceBeginCHROMIUM(kResultBucketId);
3276 helper_->SetBucketSize(kResultBucketId, 0); 3281 helper_->SetBucketSize(kResultBucketId, 0);
3282 current_trace_name_.reset(new std::string(name));
3283 }
3284
3285 void GLES2Implementation::TraceEndCHROMIUM() {
3286 GPU_CLIENT_SINGLE_THREAD_CHECK();
3287 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")");
3288 if (!current_trace_name_.get()) {
3289 SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM",
3290 "missing begin trace");
3291 return;
3292 }
3293 helper_->TraceEndCHROMIUM();
3294 TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this);
3295 current_trace_name_.reset();
3277 } 3296 }
3278 3297
3279 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { 3298 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {
3280 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3299 GPU_CLIENT_SINGLE_THREAD_CHECK();
3281 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" 3300 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM("
3282 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); 3301 << target << ", " << GLES2Util::GetStringEnum(access) << ")");
3283 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { 3302 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) {
3284 SetGLError( 3303 SetGLError(
3285 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); 3304 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target");
3286 return NULL; 3305 return NULL;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3420 return; 3439 return;
3421 } 3440 }
3422 3441
3423 // Include the auto-generated part of this file. We split this because it means 3442 // Include the auto-generated part of this file. We split this because it means
3424 // we can easily edit the non-auto generated parts right here in this file 3443 // we can easily edit the non-auto generated parts right here in this file
3425 // instead of having to edit some template or the code generator. 3444 // instead of having to edit some template or the code generator.
3426 #include "../client/gles2_implementation_impl_autogen.h" 3445 #include "../client/gles2_implementation_impl_autogen.h"
3427 3446
3428 } // namespace gles2 3447 } // namespace gles2
3429 } // namespace gpu 3448 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698