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 14378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14389 GLenum dest_internal_format) { | 14389 GLenum dest_internal_format) { |
14390 GLenum source_type = 0; | 14390 GLenum source_type = 0; |
14391 GLenum source_internal_format = 0; | 14391 GLenum source_internal_format = 0; |
14392 Texture* source_texture = source_texture_ref->texture(); | 14392 Texture* source_texture = source_texture_ref->texture(); |
14393 source_texture->GetLevelType(source_texture->target(), 0, &source_type, | 14393 source_texture->GetLevelType(source_texture->target(), 0, &source_type, |
14394 &source_internal_format); | 14394 &source_internal_format); |
14395 | 14395 |
14396 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, | 14396 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, |
14397 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not | 14397 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not |
14398 // renderable on some platforms. | 14398 // renderable on some platforms. |
14399 bool valid_dest_format = dest_internal_format == GL_RGB || | 14399 bool valid_dest_format = |
14400 dest_internal_format == GL_RGBA || | 14400 dest_internal_format == GL_RGB || dest_internal_format == GL_RGBA || |
14401 dest_internal_format == GL_BGRA_EXT; | 14401 dest_internal_format == GL_RGB8 || dest_internal_format == GL_RGBA8 || |
| 14402 dest_internal_format == GL_BGRA_EXT || |
| 14403 dest_internal_format == GL_BGRA8_EXT; |
14402 bool valid_source_format = | 14404 bool valid_source_format = |
14403 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || | 14405 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || |
14404 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || | 14406 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || |
| 14407 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 || |
14405 source_internal_format == GL_LUMINANCE || | 14408 source_internal_format == GL_LUMINANCE || |
14406 source_internal_format == GL_LUMINANCE_ALPHA || | 14409 source_internal_format == GL_LUMINANCE_ALPHA || |
14407 source_internal_format == GL_BGRA_EXT || | 14410 source_internal_format == GL_BGRA_EXT || |
| 14411 source_internal_format == GL_BGRA8_EXT || |
14408 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || | 14412 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || |
14409 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; | 14413 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; |
14410 if (!valid_source_format || !valid_dest_format) { | 14414 if (!valid_source_format || !valid_dest_format) { |
14411 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 14415 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
14412 "invalid internal format"); | 14416 "invalid internal format"); |
14413 return false; | 14417 return false; |
14414 } | 14418 } |
14415 return true; | 14419 return true; |
14416 } | 14420 } |
14417 | 14421 |
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17087 } | 17091 } |
17088 | 17092 |
17089 // Include the auto-generated part of this file. We split this because it means | 17093 // Include the auto-generated part of this file. We split this because it means |
17090 // we can easily edit the non-auto generated parts right here in this file | 17094 // we can easily edit the non-auto generated parts right here in this file |
17091 // instead of having to edit some template or the code generator. | 17095 // instead of having to edit some template or the code generator. |
17092 #include "base/macros.h" | 17096 #include "base/macros.h" |
17093 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17097 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
17094 | 17098 |
17095 } // namespace gles2 | 17099 } // namespace gles2 |
17096 } // namespace gpu | 17100 } // namespace gpu |
OLD | NEW |