OLD | NEW |
---|---|
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 Loading... | |
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 if (current_trace_name_.get() != NULL) { |
jonathan.backer
2012/12/03 18:29:32
|if (current_trace_name_)| ?
dsinclair
2012/12/03 21:40:04
Done.
| |
3613 SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM", | |
3614 "trace already running"); | |
3615 return; | |
3616 } | |
3617 TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this); | |
3613 SetBucketAsCString(kResultBucketId, name); | 3618 SetBucketAsCString(kResultBucketId, name); |
3614 helper_->TraceBeginCHROMIUM(kResultBucketId); | 3619 helper_->TraceBeginCHROMIUM(kResultBucketId); |
3615 helper_->SetBucketSize(kResultBucketId, 0); | 3620 helper_->SetBucketSize(kResultBucketId, 0); |
3621 current_trace_name_.reset(new std::string(name)); | |
3622 } | |
3623 | |
3624 void GLES2Implementation::TraceEndCHROMIUM() { | |
3625 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
3626 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")"); | |
3627 if (current_trace_name_.get() == NULL) { | |
jonathan.backer
2012/12/03 18:29:32
I think that we can just |!current_trace_name_|
dsinclair
2012/12/03 21:40:04
Done.
| |
3628 SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM", | |
3629 "missing begin trace"); | |
3630 return; | |
3631 } | |
3632 helper_->TraceEndCHROMIUM(); | |
3633 TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this); | |
3634 current_trace_name_.reset(NULL); | |
3616 } | 3635 } |
3617 | 3636 |
3618 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { | 3637 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { |
3619 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3638 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
3620 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" | 3639 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" |
3621 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); | 3640 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); |
3622 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { | 3641 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { |
3623 SetGLError( | 3642 SetGLError( |
3624 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); | 3643 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); |
3625 return NULL; | 3644 return NULL; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3668 return true; | 3687 return true; |
3669 } | 3688 } |
3670 | 3689 |
3671 // Include the auto-generated part of this file. We split this because it means | 3690 // 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 | 3691 // 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. | 3692 // instead of having to edit some template or the code generator. |
3674 #include "../client/gles2_implementation_impl_autogen.h" | 3693 #include "../client/gles2_implementation_impl_autogen.h" |
3675 | 3694 |
3676 } // namespace gles2 | 3695 } // namespace gles2 |
3677 } // namespace gpu | 3696 } // namespace gpu |
OLD | NEW |