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 <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 8995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9006 case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: | 9006 case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: |
| 9007 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: | 9007 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: |
| 9008 case GL_COMPRESSED_RGBA8_ETC2_EAC: | 9008 case GL_COMPRESSED_RGBA8_ETC2_EAC: |
| 9009 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: | 9009 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: |
| 9010 if (width <= 0 || height <= 0 || depth <= 0) { | 9010 if (width <= 0 || height <= 0 || depth <= 0) { |
| 9011 LOCAL_SET_GL_ERROR( | 9011 LOCAL_SET_GL_ERROR( |
| 9012 GL_INVALID_OPERATION, function_name, | 9012 GL_INVALID_OPERATION, function_name, |
| 9013 "width, height, or depth invalid"); | 9013 "width, height, or depth invalid"); |
| 9014 return false; | 9014 return false; |
| 9015 } | 9015 } |
| 9016 if (target != GL_TEXTURE_2D_ARRAY) { | 9016 if (target == GL_TEXTURE_3D) { |
| 9017 LOCAL_SET_GL_ERROR( | 9017 LOCAL_SET_GL_ERROR( |
| 9018 GL_INVALID_OPERATION, function_name, | 9018 GL_INVALID_OPERATION, function_name, |
| 9019 "target invalid for format"); | 9019 "target invalid for format"); |
| 9020 return false; | 9020 return false; |
| 9021 } | 9021 } |
| 9022 return true; | 9022 return true; |
| 9023 default: | 9023 default: |
| 9024 return false; | 9024 return false; |
| 9025 } | 9025 } |
| 9026 } | 9026 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9108 case GL_COMPRESSED_SIGNED_RG11_EAC: | 9108 case GL_COMPRESSED_SIGNED_RG11_EAC: |
| 9109 case GL_COMPRESSED_RGB8_ETC2: | 9109 case GL_COMPRESSED_RGB8_ETC2: |
| 9110 case GL_COMPRESSED_SRGB8_ETC2: | 9110 case GL_COMPRESSED_SRGB8_ETC2: |
| 9111 case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: | 9111 case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: |
| 9112 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: | 9112 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: |
| 9113 case GL_COMPRESSED_RGBA8_ETC2_EAC: | 9113 case GL_COMPRESSED_RGBA8_ETC2_EAC: |
| 9114 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: | 9114 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: |
| 9115 { | 9115 { |
| 9116 const int kBlockSize = 4; | 9116 const int kBlockSize = 4; |
| 9117 GLsizei tex_width, tex_height; | 9117 GLsizei tex_width, tex_height; |
| 9118 if (target != GL_TEXTURE_2D_ARRAY || | 9118 if (target != GL_TEXTURE_2D_ARRAY || |
|
Zhenyao Mo
2015/05/08 18:16:15
Also here.
| |
| 9119 !texture->GetLevelSize(target, level, | 9119 !texture->GetLevelSize(target, level, |
| 9120 &tex_width, &tex_height, nullptr) || | 9120 &tex_width, &tex_height, nullptr) || |
| 9121 (xoffset % kBlockSize) || (yoffset % kBlockSize) || | 9121 (xoffset % kBlockSize) || (yoffset % kBlockSize) || |
| 9122 ((width % kBlockSize) && xoffset + width != tex_width) || | 9122 ((width % kBlockSize) && xoffset + width != tex_width) || |
| 9123 ((height % kBlockSize) && yoffset + height != tex_height)) { | 9123 ((height % kBlockSize) && yoffset + height != tex_height)) { |
| 9124 LOCAL_SET_GL_ERROR( | 9124 LOCAL_SET_GL_ERROR( |
| 9125 GL_INVALID_OPERATION, function_name, | 9125 GL_INVALID_OPERATION, function_name, |
| 9126 "dimensions must match existing texture level dimensions"); | 9126 "dimensions must match existing texture level dimensions"); |
| 9127 return false; | 9127 return false; |
| 9128 } | 9128 } |
| (...skipping 3983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13112 } | 13112 } |
| 13113 } | 13113 } |
| 13114 | 13114 |
| 13115 // Include the auto-generated part of this file. We split this because it means | 13115 // Include the auto-generated part of this file. We split this because it means |
| 13116 // we can easily edit the non-auto generated parts right here in this file | 13116 // we can easily edit the non-auto generated parts right here in this file |
| 13117 // instead of having to edit some template or the code generator. | 13117 // instead of having to edit some template or the code generator. |
| 13118 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13118 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 13119 | 13119 |
| 13120 } // namespace gles2 | 13120 } // namespace gles2 |
| 13121 } // namespace gpu | 13121 } // namespace gpu |
| OLD | NEW |