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 3895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3906 } | 3906 } |
3907 if (ids == NULL) { | 3907 if (ids == NULL) { |
3908 return error::kOutOfBounds; | 3908 return error::kOutOfBounds; |
3909 } | 3909 } |
3910 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); | 3910 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); |
3911 return error::kNoError; | 3911 return error::kNoError; |
3912 } | 3912 } |
3913 | 3913 |
3914 void GLES2DecoderImpl::DoClear(GLbitfield mask) { | 3914 void GLES2DecoderImpl::DoClear(GLbitfield mask) { |
3915 if (CheckBoundFramebuffersValid("glClear")) { | 3915 if (CheckBoundFramebuffersValid("glClear")) { |
| 3916 UNSHIPPED_TRACE_EVENT_INSTANT2("test_gpu", "DoClear", "red", clear_red_, |
| 3917 "green", clear_green_); |
3916 ApplyDirtyState(); | 3918 ApplyDirtyState(); |
3917 glClear(mask); | 3919 glClear(mask); |
3918 } | 3920 } |
3919 } | 3921 } |
3920 | 3922 |
3921 void GLES2DecoderImpl::DoFramebufferRenderbuffer( | 3923 void GLES2DecoderImpl::DoFramebufferRenderbuffer( |
3922 GLenum target, GLenum attachment, GLenum renderbuffertarget, | 3924 GLenum target, GLenum attachment, GLenum renderbuffertarget, |
3923 GLuint client_renderbuffer_id) { | 3925 GLuint client_renderbuffer_id) { |
3924 FramebufferManager::FramebufferInfo* framebuffer_info = | 3926 FramebufferManager::FramebufferInfo* framebuffer_info = |
3925 GetFramebufferInfoForTarget(target); | 3927 GetFramebufferInfoForTarget(target); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4215 SetGLError(GL_INVALID_OPERATION, | 4217 SetGLError(GL_INVALID_OPERATION, |
4216 "glBlitFramebufferEXT: function not available"); | 4218 "glBlitFramebufferEXT: function not available"); |
4217 } | 4219 } |
4218 if (IsAngle()) { | 4220 if (IsAngle()) { |
4219 glBlitFramebufferANGLE( | 4221 glBlitFramebufferANGLE( |
4220 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 4222 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
4221 } else { | 4223 } else { |
4222 glBlitFramebufferEXT( | 4224 glBlitFramebufferEXT( |
4223 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 4225 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
4224 } | 4226 } |
| 4227 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", "width", srcX1 - srcX0); |
4225 } | 4228 } |
4226 | 4229 |
4227 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( | 4230 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( |
4228 GLenum target, GLsizei samples, GLenum internalformat, | 4231 GLenum target, GLsizei samples, GLenum internalformat, |
4229 GLsizei width, GLsizei height) { | 4232 GLsizei width, GLsizei height) { |
4230 if (!feature_info_->feature_flags().chromium_framebuffer_multisample) { | 4233 if (!feature_info_->feature_flags().chromium_framebuffer_multisample) { |
4231 SetGLError(GL_INVALID_OPERATION, | 4234 SetGLError(GL_INVALID_OPERATION, |
4232 "glRenderbufferStorageMultisampleEXT: function not available"); | 4235 "glRenderbufferStorageMultisampleEXT: function not available"); |
4233 return; | 4236 return; |
4234 } | 4237 } |
(...skipping 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7331 // TODO(gman): call glShaderBinary | 7334 // TODO(gman): call glShaderBinary |
7332 return error::kNoError; | 7335 return error::kNoError; |
7333 #endif | 7336 #endif |
7334 } | 7337 } |
7335 | 7338 |
7336 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 7339 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
7337 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 7340 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
7338 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 7341 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
7339 int this_frame_number = frame_number_++; | 7342 int this_frame_number = frame_number_++; |
7340 // TRACE_EVENT for gpu tests: | 7343 // TRACE_EVENT for gpu tests: |
7341 TRACE_EVENT_INSTANT1("test_gpu", "SwapBuffers", | 7344 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", |
7342 "GLImpl", static_cast<int>(gfx::GetGLImplementation())); | 7345 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), |
| 7346 "width", (is_offscreen ? offscreen_size_.width() : |
| 7347 surface_->GetSize().width())); |
7343 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 7348 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
7344 "offscreen", is_offscreen, | 7349 "offscreen", is_offscreen, |
7345 "frame", this_frame_number); | 7350 "frame", this_frame_number); |
7346 // If offscreen then don't actually SwapBuffers to the display. Just copy | 7351 // If offscreen then don't actually SwapBuffers to the display. Just copy |
7347 // the rendered frame to another frame buffer. | 7352 // the rendered frame to another frame buffer. |
7348 if (is_offscreen) { | 7353 if (is_offscreen) { |
7349 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 7354 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
7350 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 7355 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
7351 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 7356 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
7352 // fix this. | 7357 // fix this. |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7980 | 7985 |
7981 } | 7986 } |
7982 | 7987 |
7983 // Include the auto-generated part of this file. We split this because it means | 7988 // Include the auto-generated part of this file. We split this because it means |
7984 // we can easily edit the non-auto generated parts right here in this file | 7989 // we can easily edit the non-auto generated parts right here in this file |
7985 // instead of having to edit some template or the code generator. | 7990 // instead of having to edit some template or the code generator. |
7986 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 7991 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
7987 | 7992 |
7988 } // namespace gles2 | 7993 } // namespace gles2 |
7989 } // namespace gpu | 7994 } // namespace gpu |
OLD | NEW |