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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 12896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12907 GLsizei length, const GLchar* marker) { | 12907 GLsizei length, const GLchar* marker) { |
12908 if (!marker) { | 12908 if (!marker) { |
12909 marker = ""; | 12909 marker = ""; |
12910 } | 12910 } |
12911 debug_marker_manager_.SetMarker( | 12911 debug_marker_manager_.SetMarker( |
12912 length ? std::string(marker, length) : std::string(marker)); | 12912 length ? std::string(marker, length) : std::string(marker)); |
12913 } | 12913 } |
12914 | 12914 |
12915 void GLES2DecoderImpl::DoPushGroupMarkerEXT( | 12915 void GLES2DecoderImpl::DoPushGroupMarkerEXT( |
12916 GLsizei length, const GLchar* marker) { | 12916 GLsizei length, const GLchar* marker) { |
12917 // While deprecating Push/Pop Group Marker, mimic HandleTraceBeginCHROMIUM(). | |
12917 if (!marker) { | 12918 if (!marker) { |
12918 marker = ""; | 12919 marker = ""; |
12919 } | 12920 } |
12920 std::string name = length ? std::string(marker, length) : std::string(marker); | 12921 std::string name = length ? std::string(marker, length) : std::string(marker); |
12922 | |
12921 debug_marker_manager_.PushGroup(name); | 12923 debug_marker_manager_.PushGroup(name); |
12922 gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name, | 12924 gpu_tracer_->Begin("GroupMarker", name, kTraceCHROMIUM); |
vmiura
2015/06/25 00:41:57
Could there be a stacking problem between traces a
David Yen
2015/06/25 17:40:35
Done.
| |
12923 kTraceGroupMarker); | |
12924 } | 12925 } |
12925 | 12926 |
12926 void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) { | 12927 void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) { |
12927 debug_marker_manager_.PopGroup(); | 12928 // While deprecating Push/Pop Group Marker, just call trace CHROMIUM ones. |
12928 gpu_tracer_->End(kTraceGroupMarker); | 12929 if (gpu_tracer_->End(kTraceCHROMIUM)) { |
12930 debug_marker_manager_.PopGroup(); | |
12931 } | |
12929 } | 12932 } |
12930 | 12933 |
12931 void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM( | 12934 void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM( |
12932 GLenum target, GLint image_id) { | 12935 GLenum target, GLint image_id) { |
12933 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM"); | 12936 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM"); |
12934 | 12937 |
12935 if (target == GL_TEXTURE_CUBE_MAP) { | 12938 if (target == GL_TEXTURE_CUBE_MAP) { |
12936 LOCAL_SET_GL_ERROR( | 12939 LOCAL_SET_GL_ERROR( |
12937 GL_INVALID_ENUM, | 12940 GL_INVALID_ENUM, |
12938 "glBindTexImage2DCHROMIUM", "invalid target"); | 12941 "glBindTexImage2DCHROMIUM", "invalid target"); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13027 return error::kInvalidArguments; | 13030 return error::kInvalidArguments; |
13028 } | 13031 } |
13029 | 13032 |
13030 std::string category_name; | 13033 std::string category_name; |
13031 std::string trace_name; | 13034 std::string trace_name; |
13032 if (!category_bucket->GetAsString(&category_name) || | 13035 if (!category_bucket->GetAsString(&category_name) || |
13033 !name_bucket->GetAsString(&trace_name)) { | 13036 !name_bucket->GetAsString(&trace_name)) { |
13034 return error::kInvalidArguments; | 13037 return error::kInvalidArguments; |
13035 } | 13038 } |
13036 | 13039 |
13040 debug_marker_manager_.PushGroup(trace_name); | |
13037 if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) { | 13041 if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) { |
13038 LOCAL_SET_GL_ERROR( | 13042 LOCAL_SET_GL_ERROR( |
13039 GL_INVALID_OPERATION, | 13043 GL_INVALID_OPERATION, |
13040 "glTraceBeginCHROMIUM", "unable to create begin trace"); | 13044 "glTraceBeginCHROMIUM", "unable to create begin trace"); |
13041 return error::kNoError; | 13045 return error::kNoError; |
13042 } | 13046 } |
13043 return error::kNoError; | 13047 return error::kNoError; |
13044 } | 13048 } |
13045 | 13049 |
13046 void GLES2DecoderImpl::DoTraceEndCHROMIUM() { | 13050 void GLES2DecoderImpl::DoTraceEndCHROMIUM() { |
13051 debug_marker_manager_.PopGroup(); | |
13047 if (!gpu_tracer_->End(kTraceCHROMIUM)) { | 13052 if (!gpu_tracer_->End(kTraceCHROMIUM)) { |
13048 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 13053 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
13049 "glTraceEndCHROMIUM", "no trace begin found"); | 13054 "glTraceEndCHROMIUM", "no trace begin found"); |
13050 return; | 13055 return; |
13051 } | 13056 } |
13052 } | 13057 } |
13053 | 13058 |
13054 void GLES2DecoderImpl::DoDrawBuffersEXT( | 13059 void GLES2DecoderImpl::DoDrawBuffersEXT( |
13055 GLsizei count, const GLenum* bufs) { | 13060 GLsizei count, const GLenum* bufs) { |
13056 if (count > static_cast<GLsizei>(group_->max_draw_buffers())) { | 13061 if (count > static_cast<GLsizei>(group_->max_draw_buffers())) { |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13705 } | 13710 } |
13706 } | 13711 } |
13707 | 13712 |
13708 // Include the auto-generated part of this file. We split this because it means | 13713 // Include the auto-generated part of this file. We split this because it means |
13709 // we can easily edit the non-auto generated parts right here in this file | 13714 // we can easily edit the non-auto generated parts right here in this file |
13710 // instead of having to edit some template or the code generator. | 13715 // instead of having to edit some template or the code generator. |
13711 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13716 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
13712 | 13717 |
13713 } // namespace gles2 | 13718 } // namespace gles2 |
13714 } // namespace gpu | 13719 } // namespace gpu |
OLD | NEW |