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 10048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10059 } | 10059 } |
10060 | 10060 |
10061 GLenum source_type = 0; | 10061 GLenum source_type = 0; |
10062 GLenum source_internal_format = 0; | 10062 GLenum source_internal_format = 0; |
10063 source_texture->GetLevelType( | 10063 source_texture->GetLevelType( |
10064 source_texture->target(), 0, &source_type, &source_internal_format); | 10064 source_texture->target(), 0, &source_type, &source_internal_format); |
10065 | 10065 |
10066 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, | 10066 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, |
10067 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not | 10067 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not |
10068 // renderable on some platforms. | 10068 // renderable on some platforms. |
10069 bool valid_dest_format = | 10069 bool valid_dest_format = internal_format == GL_RGB || |
10070 internal_format == GL_RGB || internal_format == GL_RGBA; | 10070 internal_format == GL_RGBA || |
| 10071 internal_format == GL_BGRA_EXT; |
10071 bool valid_source_format = source_internal_format == GL_ALPHA || | 10072 bool valid_source_format = source_internal_format == GL_ALPHA || |
10072 source_internal_format == GL_RGB || | 10073 source_internal_format == GL_RGB || |
10073 source_internal_format == GL_RGBA || | 10074 source_internal_format == GL_RGBA || |
10074 source_internal_format == GL_LUMINANCE || | 10075 source_internal_format == GL_LUMINANCE || |
10075 source_internal_format == GL_LUMINANCE_ALPHA || | 10076 source_internal_format == GL_LUMINANCE_ALPHA || |
10076 source_internal_format == GL_BGRA_EXT; | 10077 source_internal_format == GL_BGRA_EXT; |
10077 if (!valid_source_format || !valid_dest_format) { | 10078 if (!valid_source_format || !valid_dest_format) { |
10078 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 10079 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
10079 "glCopyTextureCHROMIUM", | 10080 "glCopyTextureCHROMIUM", |
10080 "invalid internal format"); | 10081 "invalid internal format"); |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11016 } | 11017 } |
11017 } | 11018 } |
11018 | 11019 |
11019 // Include the auto-generated part of this file. We split this because it means | 11020 // Include the auto-generated part of this file. We split this because it means |
11020 // we can easily edit the non-auto generated parts right here in this file | 11021 // we can easily edit the non-auto generated parts right here in this file |
11021 // instead of having to edit some template or the code generator. | 11022 // instead of having to edit some template or the code generator. |
11022 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11023 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11023 | 11024 |
11024 } // namespace gles2 | 11025 } // namespace gles2 |
11025 } // namespace gpu | 11026 } // namespace gpu |
OLD | NEW |