| 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 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3128 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3128 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3129 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()"); | 3129 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPopGroupMarkerEXT()"); |
| 3130 helper_->PopGroupMarkerEXT(); | 3130 helper_->PopGroupMarkerEXT(); |
| 3131 debug_marker_manager_.PopGroup(); | 3131 debug_marker_manager_.PopGroup(); |
| 3132 } | 3132 } |
| 3133 | 3133 |
| 3134 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) { | 3134 void GLES2Implementation::TraceBeginCHROMIUM(const char* name) { |
| 3135 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3135 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3136 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM(" | 3136 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM(" |
| 3137 << name << ")"); | 3137 << name << ")"); |
| 3138 | 3138 if (current_trace_name_.get()) { |
| 3139 SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM", |
| 3140 "trace already running"); |
| 3141 return; |
| 3142 } |
| 3143 TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this); |
| 3139 SetBucketAsCString(kResultBucketId, name); | 3144 SetBucketAsCString(kResultBucketId, name); |
| 3140 helper_->TraceBeginCHROMIUM(kResultBucketId); | 3145 helper_->TraceBeginCHROMIUM(kResultBucketId); |
| 3141 helper_->SetBucketSize(kResultBucketId, 0); | 3146 helper_->SetBucketSize(kResultBucketId, 0); |
| 3147 current_trace_name_.reset(new std::string(name)); |
| 3148 } |
| 3149 |
| 3150 void GLES2Implementation::TraceEndCHROMIUM() { |
| 3151 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3152 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")"); |
| 3153 if (!current_trace_name_.get()) { |
| 3154 SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM", |
| 3155 "missing begin trace"); |
| 3156 return; |
| 3157 } |
| 3158 helper_->TraceEndCHROMIUM(); |
| 3159 TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this); |
| 3160 current_trace_name_.reset(NULL); |
| 3142 } | 3161 } |
| 3143 | 3162 |
| 3144 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { | 3163 void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { |
| 3145 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3164 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3146 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" | 3165 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" |
| 3147 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); | 3166 << target << ", " << GLES2Util::GetStringEnum(access) << ")"); |
| 3148 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { | 3167 if (target != GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) { |
| 3149 SetGLError( | 3168 SetGLError( |
| 3150 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); | 3169 GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target"); |
| 3151 return NULL; | 3170 return NULL; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3284 return; | 3303 return; |
| 3285 } | 3304 } |
| 3286 | 3305 |
| 3287 // Include the auto-generated part of this file. We split this because it means | 3306 // Include the auto-generated part of this file. We split this because it means |
| 3288 // we can easily edit the non-auto generated parts right here in this file | 3307 // we can easily edit the non-auto generated parts right here in this file |
| 3289 // instead of having to edit some template or the code generator. | 3308 // instead of having to edit some template or the code generator. |
| 3290 #include "../client/gles2_implementation_impl_autogen.h" | 3309 #include "../client/gles2_implementation_impl_autogen.h" |
| 3291 | 3310 |
| 3292 } // namespace gles2 | 3311 } // namespace gles2 |
| 3293 } // namespace gpu | 3312 } // namespace gpu |
| OLD | NEW |