| 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 <list> | 10 #include <list> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <stack> | 12 #include <stack> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/at_exit.h" | 16 #include "base/at_exit.h" |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/debug/trace_event.h" | 19 #include "base/debug/trace_event.h" |
| 20 #include "base/debug/trace_event_synthetic_delay.h" |
| 20 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 22 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 23 #define GLES2_GPU_SERVICE 1 | 24 #define GLES2_GPU_SERVICE 1 |
| 24 #include "gpu/command_buffer/common/debug_marker_manager.h" | 25 #include "gpu/command_buffer/common/debug_marker_manager.h" |
| 25 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 26 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 26 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 27 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 27 #include "gpu/command_buffer/common/id_allocator.h" | 28 #include "gpu/command_buffer/common/id_allocator.h" |
| 28 #include "gpu/command_buffer/common/mailbox.h" | 29 #include "gpu/command_buffer/common/mailbox.h" |
| 29 #include "gpu/command_buffer/service/async_pixel_transfer_delegate.h" | 30 #include "gpu/command_buffer/service/async_pixel_transfer_delegate.h" |
| (...skipping 8775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8805 int this_frame_number = frame_number_++; | 8806 int this_frame_number = frame_number_++; |
| 8806 // TRACE_EVENT for gpu tests: | 8807 // TRACE_EVENT for gpu tests: |
| 8807 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", | 8808 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", |
| 8808 TRACE_EVENT_SCOPE_THREAD, | 8809 TRACE_EVENT_SCOPE_THREAD, |
| 8809 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), | 8810 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), |
| 8810 "width", (is_offscreen ? offscreen_size_.width() : | 8811 "width", (is_offscreen ? offscreen_size_.width() : |
| 8811 surface_->GetSize().width())); | 8812 surface_->GetSize().width())); |
| 8812 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", | 8813 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", |
| 8813 "offscreen", is_offscreen, | 8814 "offscreen", is_offscreen, |
| 8814 "frame", this_frame_number); | 8815 "frame", this_frame_number); |
| 8816 { |
| 8817 TRACE_EVENT_SYNTHETIC_DELAY("gpu.SwapBuffers"); |
| 8818 } |
| 8819 |
| 8815 bool is_tracing; | 8820 bool is_tracing; |
| 8816 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), | 8821 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), |
| 8817 &is_tracing); | 8822 &is_tracing); |
| 8818 if (is_tracing) { | 8823 if (is_tracing) { |
| 8819 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); | 8824 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); |
| 8820 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( | 8825 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( |
| 8821 is_offscreen ? offscreen_size_ : surface_->GetSize()); | 8826 is_offscreen ? offscreen_size_ : surface_->GetSize()); |
| 8822 } | 8827 } |
| 8823 | 8828 |
| 8824 // If offscreen then don't actually SwapBuffers to the display. Just copy | 8829 // If offscreen then don't actually SwapBuffers to the display. Just copy |
| (...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10511 DoDidUseTexImageIfNeeded(texture, texture->target()); | 10516 DoDidUseTexImageIfNeeded(texture, texture->target()); |
| 10512 } | 10517 } |
| 10513 | 10518 |
| 10514 // Include the auto-generated part of this file. We split this because it means | 10519 // Include the auto-generated part of this file. We split this because it means |
| 10515 // we can easily edit the non-auto generated parts right here in this file | 10520 // we can easily edit the non-auto generated parts right here in this file |
| 10516 // instead of having to edit some template or the code generator. | 10521 // instead of having to edit some template or the code generator. |
| 10517 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10522 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10518 | 10523 |
| 10519 } // namespace gles2 | 10524 } // namespace gles2 |
| 10520 } // namespace gpu | 10525 } // namespace gpu |
| OLD | NEW |