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> |
(...skipping 4753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4764 } | 4764 } |
4765 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); | 4765 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); |
4766 return error::kNoError; | 4766 return error::kNoError; |
4767 } | 4767 } |
4768 | 4768 |
4769 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { | 4769 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { |
4770 DCHECK(!ShouldDeferDraws()); | 4770 DCHECK(!ShouldDeferDraws()); |
4771 if (CheckBoundFramebuffersValid("glClear")) { | 4771 if (CheckBoundFramebuffersValid("glClear")) { |
4772 UNSHIPPED_TRACE_EVENT_INSTANT2( | 4772 UNSHIPPED_TRACE_EVENT_INSTANT2( |
4773 "test_gpu", "DoClear", | 4773 "test_gpu", "DoClear", |
| 4774 TRACE_EVENT_SCOPE_THREAD, |
4774 "red", state_.color_clear_red, | 4775 "red", state_.color_clear_red, |
4775 "green", state_.color_clear_green); | 4776 "green", state_.color_clear_green); |
4776 ApplyDirtyState(); | 4777 ApplyDirtyState(); |
4777 glClear(mask); | 4778 glClear(mask); |
4778 } | 4779 } |
4779 return error::kNoError; | 4780 return error::kNoError; |
4780 } | 4781 } |
4781 | 4782 |
4782 void GLES2DecoderImpl::DoFramebufferRenderbuffer( | 4783 void GLES2DecoderImpl::DoFramebufferRenderbuffer( |
4783 GLenum target, GLenum attachment, GLenum renderbuffertarget, | 4784 GLenum target, GLenum attachment, GLenum renderbuffertarget, |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5047 | 5048 |
5048 glDisable(GL_SCISSOR_TEST); | 5049 glDisable(GL_SCISSOR_TEST); |
5049 if (IsAngle()) { | 5050 if (IsAngle()) { |
5050 glBlitFramebufferANGLE( | 5051 glBlitFramebufferANGLE( |
5051 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 5052 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
5052 } else { | 5053 } else { |
5053 glBlitFramebufferEXT( | 5054 glBlitFramebufferEXT( |
5054 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 5055 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
5055 } | 5056 } |
5056 EnableDisable(GL_SCISSOR_TEST, state_.enable_flags.scissor_test); | 5057 EnableDisable(GL_SCISSOR_TEST, state_.enable_flags.scissor_test); |
5057 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", "width", srcX1 - srcX0); | 5058 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", TRACE_EVENT_SCOPE_THREAD, |
| 5059 "width", srcX1 - srcX0); |
5058 } | 5060 } |
5059 | 5061 |
5060 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( | 5062 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( |
5061 GLenum target, GLsizei samples, GLenum internalformat, | 5063 GLenum target, GLsizei samples, GLenum internalformat, |
5062 GLsizei width, GLsizei height) { | 5064 GLsizei width, GLsizei height) { |
5063 if (!features().chromium_framebuffer_multisample) { | 5065 if (!features().chromium_framebuffer_multisample) { |
5064 LOCAL_SET_GL_ERROR( | 5066 LOCAL_SET_GL_ERROR( |
5065 GL_INVALID_OPERATION, | 5067 GL_INVALID_OPERATION, |
5066 "glRenderbufferStorageMultisample", "function not available"); | 5068 "glRenderbufferStorageMultisample", "function not available"); |
5067 return; | 5069 return; |
(...skipping 3805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8873 #endif | 8875 #endif |
8874 } | 8876 } |
8875 | 8877 |
8876 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 8878 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
8877 uint32 immediate_data_size, const cmds::SwapBuffers& c) { | 8879 uint32 immediate_data_size, const cmds::SwapBuffers& c) { |
8878 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 8880 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
8879 | 8881 |
8880 int this_frame_number = frame_number_++; | 8882 int this_frame_number = frame_number_++; |
8881 // TRACE_EVENT for gpu tests: | 8883 // TRACE_EVENT for gpu tests: |
8882 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", | 8884 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", |
| 8885 TRACE_EVENT_SCOPE_THREAD, |
8883 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), | 8886 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), |
8884 "width", (is_offscreen ? offscreen_size_.width() : | 8887 "width", (is_offscreen ? offscreen_size_.width() : |
8885 surface_->GetSize().width())); | 8888 surface_->GetSize().width())); |
8886 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 8889 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
8887 "offscreen", is_offscreen, | 8890 "offscreen", is_offscreen, |
8888 "frame", this_frame_number); | 8891 "frame", this_frame_number); |
8889 // If offscreen then don't actually SwapBuffers to the display. Just copy | 8892 // If offscreen then don't actually SwapBuffers to the display. Just copy |
8890 // the rendered frame to another frame buffer. | 8893 // the rendered frame to another frame buffer. |
8891 if (is_offscreen) { | 8894 if (is_offscreen) { |
8892 TRACE_EVENT2("gpu", "Offscreen", | 8895 TRACE_EVENT2("gpu", "Offscreen", |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10463 return error::kNoError; | 10466 return error::kNoError; |
10464 } | 10467 } |
10465 | 10468 |
10466 // Include the auto-generated part of this file. We split this because it means | 10469 // Include the auto-generated part of this file. We split this because it means |
10467 // we can easily edit the non-auto generated parts right here in this file | 10470 // we can easily edit the non-auto generated parts right here in this file |
10468 // instead of having to edit some template or the code generator. | 10471 // instead of having to edit some template or the code generator. |
10469 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10472 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10470 | 10473 |
10471 } // namespace gles2 | 10474 } // namespace gles2 |
10472 } // namespace gpu | 10475 } // namespace gpu |
OLD | NEW |