Chromium Code Reviews| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 11099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11110 if (!validators_->texture_3_d_target.IsValid(target)) { | 11110 if (!validators_->texture_3_d_target.IsValid(target)) { |
| 11111 LOCAL_SET_GL_ERROR( | 11111 LOCAL_SET_GL_ERROR( |
| 11112 GL_INVALID_ENUM, "glCompressedTexSubImage3D", "target"); | 11112 GL_INVALID_ENUM, "glCompressedTexSubImage3D", "target"); |
| 11113 return; | 11113 return; |
| 11114 } | 11114 } |
| 11115 if (!validators_->compressed_texture_format.IsValid(format)) { | 11115 if (!validators_->compressed_texture_format.IsValid(format)) { |
| 11116 LOCAL_SET_GL_ERROR_INVALID_ENUM( | 11116 LOCAL_SET_GL_ERROR_INVALID_ENUM( |
| 11117 "glCompressedTexSubImage3D", format, "format"); | 11117 "glCompressedTexSubImage3D", format, "format"); |
| 11118 return; | 11118 return; |
| 11119 } | 11119 } |
| 11120 if (width < 0 || height < 0 || depth < 0) { | 11120 if (!texture_manager()->ValidForTarget(target, level, width, height, depth)) { |
| 11121 LOCAL_SET_GL_ERROR( | 11121 LOCAL_SET_GL_ERROR( |
| 11122 GL_INVALID_VALUE, "glCompressedTexSubImage3D", "size < 0"); | 11122 GL_INVALID_VALUE, |
| 11123 "glCompressedTexSubImage3D", "dimensions out of range"); | |
| 11123 return; | 11124 return; |
| 11124 } | 11125 } |
| 11125 if (image_size < 0) { | 11126 if (image_size < 0) { |
| 11126 LOCAL_SET_GL_ERROR( | 11127 LOCAL_SET_GL_ERROR( |
| 11127 GL_INVALID_VALUE, "glCompressedTexSubImage3D", "imageSize < 0"); | 11128 GL_INVALID_VALUE, "glCompressedTexSubImage3D", "imageSize < 0"); |
| 11128 return; | 11129 return; |
| 11129 } | 11130 } |
| 11130 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( | 11131 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
| 11131 &state_, target); | 11132 &state_, target); |
| 11132 if (!texture_ref) { | 11133 if (!texture_ref) { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11326 void GLES2DecoderImpl::DoCompressedTexSubImage2D( | 11327 void GLES2DecoderImpl::DoCompressedTexSubImage2D( |
| 11327 GLenum target, | 11328 GLenum target, |
| 11328 GLint level, | 11329 GLint level, |
| 11329 GLint xoffset, | 11330 GLint xoffset, |
| 11330 GLint yoffset, | 11331 GLint yoffset, |
| 11331 GLsizei width, | 11332 GLsizei width, |
| 11332 GLsizei height, | 11333 GLsizei height, |
| 11333 GLenum format, | 11334 GLenum format, |
| 11334 GLsizei image_size, | 11335 GLsizei image_size, |
| 11335 const void * data) { | 11336 const void * data) { |
| 11337 if (!texture_manager()->ValidForTarget(target, level, width, height, 1)) { | |
|
Zhenyao Mo
2016/03/04 17:39:58
This needs to happen after GetTextureInfoForTarget
yunchao
2016/03/07 02:58:19
Done.
| |
| 11338 LOCAL_SET_GL_ERROR( | |
| 11339 GL_INVALID_VALUE, | |
| 11340 "glCompressedTexSubImage2D", "dimensions out of range"); | |
| 11341 return; | |
| 11342 } | |
| 11336 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( | 11343 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
| 11337 &state_, target); | 11344 &state_, target); |
| 11338 if (!texture_ref) { | 11345 if (!texture_ref) { |
| 11339 LOCAL_SET_GL_ERROR( | 11346 LOCAL_SET_GL_ERROR( |
| 11340 GL_INVALID_OPERATION, | 11347 GL_INVALID_OPERATION, |
| 11341 "glCompressedTexSubImage2D", "unknown texture for target"); | 11348 "glCompressedTexSubImage2D", "unknown texture for target"); |
| 11342 return; | 11349 return; |
| 11343 } | 11350 } |
| 11344 Texture* texture = texture_ref->texture(); | 11351 Texture* texture = texture_ref->texture(); |
| 11345 GLenum type = 0; | 11352 GLenum type = 0; |
| (...skipping 4604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 15950 } | 15957 } |
| 15951 | 15958 |
| 15952 // Include the auto-generated part of this file. We split this because it means | 15959 // Include the auto-generated part of this file. We split this because it means |
| 15953 // we can easily edit the non-auto generated parts right here in this file | 15960 // we can easily edit the non-auto generated parts right here in this file |
| 15954 // instead of having to edit some template or the code generator. | 15961 // instead of having to edit some template or the code generator. |
| 15955 #include "base/macros.h" | 15962 #include "base/macros.h" |
| 15956 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15963 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 15957 | 15964 |
| 15958 } // namespace gles2 | 15965 } // namespace gles2 |
| 15959 } // namespace gpu | 15966 } // namespace gpu |
| OLD | NEW |