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 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3779 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 3779 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
3780 caps.flips_vertically = !is_offscreen && surface_->FlipsVertically(); | 3780 caps.flips_vertically = !is_offscreen && surface_->FlipsVertically(); |
3781 caps.msaa_is_slow = workarounds().msaa_is_slow; | 3781 caps.msaa_is_slow = workarounds().msaa_is_slow; |
3782 caps.dc_layers = supports_dc_layers_; | 3782 caps.dc_layers = supports_dc_layers_; |
3783 | 3783 |
3784 caps.blend_equation_advanced = | 3784 caps.blend_equation_advanced = |
3785 feature_info_->feature_flags().blend_equation_advanced; | 3785 feature_info_->feature_flags().blend_equation_advanced; |
3786 caps.blend_equation_advanced_coherent = | 3786 caps.blend_equation_advanced_coherent = |
3787 feature_info_->feature_flags().blend_equation_advanced_coherent; | 3787 feature_info_->feature_flags().blend_equation_advanced_coherent; |
3788 caps.texture_rg = feature_info_->feature_flags().ext_texture_rg; | 3788 caps.texture_rg = feature_info_->feature_flags().ext_texture_rg; |
| 3789 caps.texture_norm16 = feature_info_->feature_flags().ext_texture_norm16; |
3789 caps.texture_half_float_linear = | 3790 caps.texture_half_float_linear = |
3790 feature_info_->feature_flags().enable_texture_half_float_linear; | 3791 feature_info_->feature_flags().enable_texture_half_float_linear; |
3791 caps.color_buffer_half_float_rgba = | 3792 caps.color_buffer_half_float_rgba = |
3792 feature_info_->feature_flags().enable_color_buffer_float || | 3793 feature_info_->feature_flags().enable_color_buffer_float || |
3793 feature_info_->feature_flags().enable_color_buffer_half_float; | 3794 feature_info_->feature_flags().enable_color_buffer_half_float; |
3794 caps.image_ycbcr_422 = | 3795 caps.image_ycbcr_422 = |
3795 feature_info_->feature_flags().chromium_image_ycbcr_422; | 3796 feature_info_->feature_flags().chromium_image_ycbcr_422; |
3796 caps.image_ycbcr_420v = | 3797 caps.image_ycbcr_420v = |
3797 feature_info_->feature_flags().chromium_image_ycbcr_420v; | 3798 feature_info_->feature_flags().chromium_image_ycbcr_420v; |
3798 caps.max_copy_texture_chromium_size = | 3799 caps.max_copy_texture_chromium_size = |
(...skipping 12783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16582 case GL_RGBA32F: | 16583 case GL_RGBA32F: |
16583 valid_dest_format = | 16584 valid_dest_format = |
16584 feature_info_->ext_color_buffer_float_available() || | 16585 feature_info_->ext_color_buffer_float_available() || |
16585 feature_info_->feature_flags().chromium_color_buffer_float_rgba; | 16586 feature_info_->feature_flags().chromium_color_buffer_float_rgba; |
16586 break; | 16587 break; |
16587 default: | 16588 default: |
16588 valid_dest_format = false; | 16589 valid_dest_format = false; |
16589 break; | 16590 break; |
16590 } | 16591 } |
16591 | 16592 |
| 16593 // TODO(aleksandar.stojiljkovic): Use sized internal formats: crbug.com/628064 |
16592 bool valid_source_format = | 16594 bool valid_source_format = |
16593 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || | 16595 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || |
16594 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || | 16596 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || |
16595 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 || | 16597 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 || |
16596 source_internal_format == GL_LUMINANCE || | 16598 source_internal_format == GL_LUMINANCE || |
16597 source_internal_format == GL_LUMINANCE_ALPHA || | 16599 source_internal_format == GL_LUMINANCE_ALPHA || |
16598 source_internal_format == GL_BGRA_EXT || | 16600 source_internal_format == GL_BGRA_EXT || |
16599 source_internal_format == GL_BGRA8_EXT || | 16601 source_internal_format == GL_BGRA8_EXT || |
16600 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || | 16602 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || |
16601 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; | 16603 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM || |
| 16604 source_internal_format == GL_R16_EXT; |
16602 if (!valid_source_format) { | 16605 if (!valid_source_format) { |
16603 std::string msg = "invalid source internal format " + | 16606 std::string msg = "invalid source internal format " + |
16604 GLES2Util::GetStringEnum(source_internal_format); | 16607 GLES2Util::GetStringEnum(source_internal_format); |
16605 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 16608 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
16606 msg.c_str()); | 16609 msg.c_str()); |
16607 return false; | 16610 return false; |
16608 } | 16611 } |
16609 if (!valid_dest_format) { | 16612 if (!valid_dest_format) { |
16610 std::string msg = "invalid dest internal format " + | 16613 std::string msg = "invalid dest internal format " + |
16611 GLES2Util::GetStringEnum(dest_internal_format); | 16614 GLES2Util::GetStringEnum(dest_internal_format); |
(...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19604 } | 19607 } |
19605 | 19608 |
19606 // Include the auto-generated part of this file. We split this because it means | 19609 // Include the auto-generated part of this file. We split this because it means |
19607 // we can easily edit the non-auto generated parts right here in this file | 19610 // we can easily edit the non-auto generated parts right here in this file |
19608 // instead of having to edit some template or the code generator. | 19611 // instead of having to edit some template or the code generator. |
19609 #include "base/macros.h" | 19612 #include "base/macros.h" |
19610 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19613 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19611 | 19614 |
19612 } // namespace gles2 | 19615 } // namespace gles2 |
19613 } // namespace gpu | 19616 } // namespace gpu |
OLD | NEW |