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