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

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 3591 matching lines...) Expand 10 before | Expand all | Expand 10 after
3602 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3602 GPU_CLIENT_SINGLE_THREAD_CHECK();
3603 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()"); 3603 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()");
3604 helper_->PopGroupMarkerEXT(); 3604 helper_->PopGroupMarkerEXT();
3605 debug_marker_manager_.PopGroup(); 3605 debug_marker_manager_.PopGroup();
3606 } 3606 }
3607 3607
3608 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) { 3608 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) {
3609 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3609 GPU_CLIENT_SINGLE_THREAD_CHECK();
3610 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM(" 3610 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM("
3611 << name << ")"); 3611 << name << ")");
3612 3612 TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this);
3613 SetBucketAsCString(kResultBucketId, name); 3613 SetBucketAsCString(kResultBucketId, name);
3614 helper_->TraceBeginCHROMIUM(kResultBucketId); 3614 helper_->TraceBeginCHROMIUM(kResultBucketId);
3615 helper_->SetBucketSize(kResultBucketId, 0); 3615 helper_->SetBucketSize(kResultBucketId, 0);
3616 current_trace_name_.reset(new std::string(name));
jonathan.backer 2012/12/03 14:23:14 Can we do a client side check if this is already s
dsinclair 2012/12/03 16:47:42 Done.
3617 }
3618
3619 void GLES2Implementation::TraceEndCHROMIUM() {
3620 GPU_CLIENT_SINGLE_THREAD_CHECK();
3621 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")");
3622 helper_->TraceEndCHROMIUM();
3623
3624 if (current_trace_name_.get())
3625 TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this);
jonathan.backer 2012/12/03 14:23:14 else ERROR?
dsinclair 2012/12/03 16:47:42 Done.
3616 } 3626 }
3617 3627
3618 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { 3628 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {
3619 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3629 GPU_CLIENT_SINGLE_THREAD_CHECK();
3620 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" 3630 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM("
3621 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); 3631 << target << ", " << GLES2Util::GetStringEnum(access) << ")");
3622 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { 3632 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) {
3623 SetGLError( 3633 SetGLError(
3624 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); 3634 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target");
3625 return NULL; 3635 return NULL;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
3668 return true; 3678 return true;
3669 } 3679 }
3670 3680
3671 // Include the auto-generated part of this file. We split this because it means 3681 // Include the auto-generated part of this file. We split this because it means
3672 // we can easily edit the non-auto generated parts right here in this file 3682 // we can easily edit the non-auto generated parts right here in this file
3673 // instead of having to edit some template or the code generator. 3683 // instead of having to edit some template or the code generator.
3674 #include "../client/gles2_implementation_impl_autogen.h" 3684 #include "../client/gles2_implementation_impl_autogen.h"
3675 3685
3676 } // namespace gles2 3686 } // namespace gles2
3677 } // namespace gpu 3687 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698