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 8269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8280 GL_INVALID_VALUE, "glCompressedTexSubImage2D", "imageSize < 0"); | 8280 GL_INVALID_VALUE, "glCompressedTexSubImage2D", "imageSize < 0"); |
8281 return error::kNoError; | 8281 return error::kNoError; |
8282 } | 8282 } |
8283 DoCompressedTexSubImage2D( | 8283 DoCompressedTexSubImage2D( |
8284 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 8284 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
8285 return error::kNoError; | 8285 return error::kNoError; |
8286 } | 8286 } |
8287 | 8287 |
8288 error::Error GLES2DecoderImpl::HandleTexImage2D( | 8288 error::Error GLES2DecoderImpl::HandleTexImage2D( |
8289 uint32 immediate_data_size, const cmds::TexImage2D& c) { | 8289 uint32 immediate_data_size, const cmds::TexImage2D& c) { |
8290 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleTexImage2D"); | 8290 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleTexImage2D", |
| 8291 "width", c.width, "height", c.height); |
8291 // Set as failed for now, but if it successed, this will be set to not failed. | 8292 // Set as failed for now, but if it successed, this will be set to not failed. |
8292 texture_state_.tex_image_2d_failed = true; | 8293 texture_state_.tex_image_2d_failed = true; |
8293 GLenum target = static_cast<GLenum>(c.target); | 8294 GLenum target = static_cast<GLenum>(c.target); |
8294 GLint level = static_cast<GLint>(c.level); | 8295 GLint level = static_cast<GLint>(c.level); |
8295 // TODO(kloveless): Change TexImage2D command to use unsigned integer | 8296 // TODO(kloveless): Change TexImage2D command to use unsigned integer |
8296 // for internalformat. | 8297 // for internalformat. |
8297 GLenum internal_format = static_cast<GLenum>(c.internalformat); | 8298 GLenum internal_format = static_cast<GLenum>(c.internalformat); |
8298 GLsizei width = static_cast<GLsizei>(c.width); | 8299 GLsizei width = static_cast<GLsizei>(c.width); |
8299 GLsizei height = static_cast<GLsizei>(c.height); | 8300 GLsizei height = static_cast<GLsizei>(c.height); |
8300 GLint border = static_cast<GLint>(c.border); | 8301 GLint border = static_cast<GLint>(c.border); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8754 ScopedTextureUploadTimer timer(&texture_state_); | 8755 ScopedTextureUploadTimer timer(&texture_state_); |
8755 glTexSubImage2D( | 8756 glTexSubImage2D( |
8756 target, level, xoffset, yoffset, width, height, format, type, data); | 8757 target, level, xoffset, yoffset, width, height, format, type, data); |
8757 } | 8758 } |
8758 texture_manager()->SetLevelCleared(texture_ref, target, level, true); | 8759 texture_manager()->SetLevelCleared(texture_ref, target, level, true); |
8759 return error::kNoError; | 8760 return error::kNoError; |
8760 } | 8761 } |
8761 | 8762 |
8762 error::Error GLES2DecoderImpl::HandleTexSubImage2D( | 8763 error::Error GLES2DecoderImpl::HandleTexSubImage2D( |
8763 uint32 immediate_data_size, const cmds::TexSubImage2D& c) { | 8764 uint32 immediate_data_size, const cmds::TexSubImage2D& c) { |
8764 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleTexSubImage2D"); | 8765 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleTexSubImage2D", |
| 8766 "width", c.width, "height", c.height); |
8765 GLboolean internal = static_cast<GLboolean>(c.internal); | 8767 GLboolean internal = static_cast<GLboolean>(c.internal); |
8766 if (internal == GL_TRUE && texture_state_.tex_image_2d_failed) | 8768 if (internal == GL_TRUE && texture_state_.tex_image_2d_failed) |
8767 return error::kNoError; | 8769 return error::kNoError; |
8768 | 8770 |
8769 GLenum target = static_cast<GLenum>(c.target); | 8771 GLenum target = static_cast<GLenum>(c.target); |
8770 GLint level = static_cast<GLint>(c.level); | 8772 GLint level = static_cast<GLint>(c.level); |
8771 GLint xoffset = static_cast<GLint>(c.xoffset); | 8773 GLint xoffset = static_cast<GLint>(c.xoffset); |
8772 GLint yoffset = static_cast<GLint>(c.yoffset); | 8774 GLint yoffset = static_cast<GLint>(c.yoffset); |
8773 GLsizei width = static_cast<GLsizei>(c.width); | 8775 GLsizei width = static_cast<GLsizei>(c.width); |
8774 GLsizei height = static_cast<GLsizei>(c.height); | 8776 GLsizei height = static_cast<GLsizei>(c.height); |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10126 return GL_NONE; | 10128 return GL_NONE; |
10127 } | 10129 } |
10128 } | 10130 } |
10129 | 10131 |
10130 void GLES2DecoderImpl::DoTexStorage2DEXT( | 10132 void GLES2DecoderImpl::DoTexStorage2DEXT( |
10131 GLenum target, | 10133 GLenum target, |
10132 GLint levels, | 10134 GLint levels, |
10133 GLenum internal_format, | 10135 GLenum internal_format, |
10134 GLsizei width, | 10136 GLsizei width, |
10135 GLsizei height) { | 10137 GLsizei height) { |
10136 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoTexStorage2DEXT"); | 10138 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoTexStorage2DEXT", |
| 10139 "width", width, "height", height); |
10137 if (!texture_manager()->ValidForTarget(target, 0, width, height, 1) || | 10140 if (!texture_manager()->ValidForTarget(target, 0, width, height, 1) || |
10138 TextureManager::ComputeMipMapCount(target, width, height, 1) < levels) { | 10141 TextureManager::ComputeMipMapCount(target, width, height, 1) < levels) { |
10139 LOCAL_SET_GL_ERROR( | 10142 LOCAL_SET_GL_ERROR( |
10140 GL_INVALID_VALUE, "glTexStorage2DEXT", "dimensions out of range"); | 10143 GL_INVALID_VALUE, "glTexStorage2DEXT", "dimensions out of range"); |
10141 return; | 10144 return; |
10142 } | 10145 } |
10143 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( | 10146 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
10144 &state_, target); | 10147 &state_, target); |
10145 if (!texture_ref) { | 10148 if (!texture_ref) { |
10146 LOCAL_SET_GL_ERROR( | 10149 LOCAL_SET_GL_ERROR( |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10797 } | 10800 } |
10798 } | 10801 } |
10799 | 10802 |
10800 // Include the auto-generated part of this file. We split this because it means | 10803 // Include the auto-generated part of this file. We split this because it means |
10801 // we can easily edit the non-auto generated parts right here in this file | 10804 // we can easily edit the non-auto generated parts right here in this file |
10802 // instead of having to edit some template or the code generator. | 10805 // instead of having to edit some template or the code generator. |
10803 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10806 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10804 | 10807 |
10805 } // namespace gles2 | 10808 } // namespace gles2 |
10806 } // namespace gpu | 10809 } // namespace gpu |
OLD | NEW |