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 13140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13151 source_texture->GetLevelType(source_texture->target(), 0, &source_type, | 13151 source_texture->GetLevelType(source_texture->target(), 0, &source_type, |
13152 &source_internal_format); | 13152 &source_internal_format); |
13153 | 13153 |
13154 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, | 13154 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, |
13155 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not | 13155 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not |
13156 // renderable on some platforms. | 13156 // renderable on some platforms. |
13157 bool valid_dest_format = dest_internal_format == GL_RGB || | 13157 bool valid_dest_format = dest_internal_format == GL_RGB || |
13158 dest_internal_format == GL_RGBA || | 13158 dest_internal_format == GL_RGBA || |
13159 dest_internal_format == GL_BGRA_EXT; | 13159 dest_internal_format == GL_BGRA_EXT; |
13160 bool valid_source_format = | 13160 bool valid_source_format = |
13161 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || | 13161 source_internal_format == GL_R8 || source_internal_format == GL_RED || |
Daniele Castagna
2016/02/22 22:53:43
Also allowed GL_RED as source internal format in c
| |
13162 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || | 13162 source_internal_format == GL_ALPHA || source_internal_format == GL_RGB || |
13163 source_internal_format == GL_RGBA || | |
13163 source_internal_format == GL_LUMINANCE || | 13164 source_internal_format == GL_LUMINANCE || |
13164 source_internal_format == GL_LUMINANCE_ALPHA || | 13165 source_internal_format == GL_LUMINANCE_ALPHA || |
13165 source_internal_format == GL_BGRA_EXT || | 13166 source_internal_format == GL_BGRA_EXT || |
13166 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || | 13167 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || |
13167 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; | 13168 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; |
13168 if (!valid_source_format || !valid_dest_format) { | 13169 if (!valid_source_format || !valid_dest_format) { |
13169 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 13170 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
13170 "invalid internal format"); | 13171 "invalid internal format"); |
13171 return false; | 13172 return false; |
13172 } | 13173 } |
(...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15747 } | 15748 } |
15748 | 15749 |
15749 // Include the auto-generated part of this file. We split this because it means | 15750 // Include the auto-generated part of this file. We split this because it means |
15750 // we can easily edit the non-auto generated parts right here in this file | 15751 // we can easily edit the non-auto generated parts right here in this file |
15751 // instead of having to edit some template or the code generator. | 15752 // instead of having to edit some template or the code generator. |
15752 #include "base/macros.h" | 15753 #include "base/macros.h" |
15753 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15754 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
15754 | 15755 |
15755 } // namespace gles2 | 15756 } // namespace gles2 |
15756 } // namespace gpu | 15757 } // namespace gpu |
OLD | NEW |