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 13158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13169 source_texture->GetLevelType(source_texture->target(), 0, &source_type, | 13169 source_texture->GetLevelType(source_texture->target(), 0, &source_type, |
13170 &source_internal_format); | 13170 &source_internal_format); |
13171 | 13171 |
13172 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, | 13172 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, |
13173 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not | 13173 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not |
13174 // renderable on some platforms. | 13174 // renderable on some platforms. |
13175 bool valid_dest_format = dest_internal_format == GL_RGB || | 13175 bool valid_dest_format = dest_internal_format == GL_RGB || |
13176 dest_internal_format == GL_RGBA || | 13176 dest_internal_format == GL_RGBA || |
13177 dest_internal_format == GL_BGRA_EXT; | 13177 dest_internal_format == GL_BGRA_EXT; |
13178 bool valid_source_format = | 13178 bool valid_source_format = |
13179 source_internal_format == GL_R8 || source_internal_format == GL_ALPHA || | 13179 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || |
13180 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || | 13180 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || |
13181 source_internal_format == GL_LUMINANCE || | 13181 source_internal_format == GL_LUMINANCE || |
13182 source_internal_format == GL_LUMINANCE_ALPHA || | 13182 source_internal_format == GL_LUMINANCE_ALPHA || |
13183 source_internal_format == GL_BGRA_EXT || | 13183 source_internal_format == GL_BGRA_EXT || |
13184 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || | 13184 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || |
13185 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; | 13185 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; |
13186 if (!valid_source_format || !valid_dest_format) { | 13186 if (!valid_source_format || !valid_dest_format) { |
13187 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 13187 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
13188 "invalid internal format"); | 13188 "invalid internal format"); |
13189 return false; | 13189 return false; |
(...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15633 } | 15633 } |
15634 | 15634 |
15635 // Include the auto-generated part of this file. We split this because it means | 15635 // Include the auto-generated part of this file. We split this because it means |
15636 // we can easily edit the non-auto generated parts right here in this file | 15636 // we can easily edit the non-auto generated parts right here in this file |
15637 // instead of having to edit some template or the code generator. | 15637 // instead of having to edit some template or the code generator. |
15638 #include "base/macros.h" | 15638 #include "base/macros.h" |
15639 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15639 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
15640 | 15640 |
15641 } // namespace gles2 | 15641 } // namespace gles2 |
15642 } // namespace gpu | 15642 } // namespace gpu |
OLD | NEW |