OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 3826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3837 } | 3837 } |
3838 if (ids == NULL) { | 3838 if (ids == NULL) { |
3839 return error::kOutOfBounds; | 3839 return error::kOutOfBounds; |
3840 } | 3840 } |
3841 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); | 3841 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); |
3842 return error::kNoError; | 3842 return error::kNoError; |
3843 } | 3843 } |
3844 | 3844 |
3845 void GLES2DecoderImpl::DoClear(GLbitfield mask) { | 3845 void GLES2DecoderImpl::DoClear(GLbitfield mask) { |
3846 if (CheckBoundFramebuffersValid("glClear")) { | 3846 if (CheckBoundFramebuffersValid("glClear")) { |
| 3847 UNSHIPPED_TRACE_EVENT_INSTANT2("test_gpu", "DoClear", "red", clear_red_, |
| 3848 "green", clear_green_); |
3847 ApplyDirtyState(); | 3849 ApplyDirtyState(); |
3848 glClear(mask); | 3850 glClear(mask); |
3849 } | 3851 } |
3850 } | 3852 } |
3851 | 3853 |
3852 void GLES2DecoderImpl::DoFramebufferRenderbuffer( | 3854 void GLES2DecoderImpl::DoFramebufferRenderbuffer( |
3853 GLenum target, GLenum attachment, GLenum renderbuffertarget, | 3855 GLenum target, GLenum attachment, GLenum renderbuffertarget, |
3854 GLuint client_renderbuffer_id) { | 3856 GLuint client_renderbuffer_id) { |
3855 FramebufferManager::FramebufferInfo* framebuffer_info = | 3857 FramebufferManager::FramebufferInfo* framebuffer_info = |
3856 GetFramebufferInfoForTarget(target); | 3858 GetFramebufferInfoForTarget(target); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4146 SetGLError(GL_INVALID_OPERATION, | 4148 SetGLError(GL_INVALID_OPERATION, |
4147 "glBlitFramebufferEXT: function not available"); | 4149 "glBlitFramebufferEXT: function not available"); |
4148 } | 4150 } |
4149 if (IsAngle()) { | 4151 if (IsAngle()) { |
4150 glBlitFramebufferANGLE( | 4152 glBlitFramebufferANGLE( |
4151 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 4153 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
4152 } else { | 4154 } else { |
4153 glBlitFramebufferEXT( | 4155 glBlitFramebufferEXT( |
4154 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 4156 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
4155 } | 4157 } |
| 4158 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", "width", srcX1 - srcX0); |
4156 } | 4159 } |
4157 | 4160 |
4158 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( | 4161 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( |
4159 GLenum target, GLsizei samples, GLenum internalformat, | 4162 GLenum target, GLsizei samples, GLenum internalformat, |
4160 GLsizei width, GLsizei height) { | 4163 GLsizei width, GLsizei height) { |
4161 if (!feature_info_->feature_flags().chromium_framebuffer_multisample) { | 4164 if (!feature_info_->feature_flags().chromium_framebuffer_multisample) { |
4162 SetGLError(GL_INVALID_OPERATION, | 4165 SetGLError(GL_INVALID_OPERATION, |
4163 "glRenderbufferStorageMultisampleEXT: function not available"); | 4166 "glRenderbufferStorageMultisampleEXT: function not available"); |
4164 return; | 4167 return; |
4165 } | 4168 } |
(...skipping 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7262 // TODO(gman): call glShaderBinary | 7265 // TODO(gman): call glShaderBinary |
7263 return error::kNoError; | 7266 return error::kNoError; |
7264 #endif | 7267 #endif |
7265 } | 7268 } |
7266 | 7269 |
7267 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 7270 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
7268 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 7271 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
7269 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 7272 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
7270 int this_frame_number = frame_number_++; | 7273 int this_frame_number = frame_number_++; |
7271 // TRACE_EVENT for gpu tests: | 7274 // TRACE_EVENT for gpu tests: |
7272 TRACE_EVENT_INSTANT1("test_gpu", "SwapBuffers", | 7275 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", |
7273 "GLImpl", static_cast<int>(gfx::GetGLImplementation())); | 7276 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), |
| 7277 "width", (is_offscreen ? offscreen_size_.width() : |
| 7278 surface_->GetSize().width())); |
7274 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 7279 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
7275 "offscreen", is_offscreen, | 7280 "offscreen", is_offscreen, |
7276 "frame", this_frame_number); | 7281 "frame", this_frame_number); |
7277 // If offscreen then don't actually SwapBuffers to the display. Just copy | 7282 // If offscreen then don't actually SwapBuffers to the display. Just copy |
7278 // the rendered frame to another frame buffer. | 7283 // the rendered frame to another frame buffer. |
7279 if (is_offscreen) { | 7284 if (is_offscreen) { |
7280 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 7285 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
7281 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 7286 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
7282 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 7287 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
7283 // fix this. | 7288 // fix this. |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7910 | 7915 |
7911 } | 7916 } |
7912 | 7917 |
7913 // Include the auto-generated part of this file. We split this because it means | 7918 // Include the auto-generated part of this file. We split this because it means |
7914 // we can easily edit the non-auto generated parts right here in this file | 7919 // we can easily edit the non-auto generated parts right here in this file |
7915 // instead of having to edit some template or the code generator. | 7920 // instead of having to edit some template or the code generator. |
7916 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 7921 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
7917 | 7922 |
7918 } // namespace gles2 | 7923 } // namespace gles2 |
7919 } // namespace gpu | 7924 } // namespace gpu |
OLD | NEW |