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 12754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16553 case GL_RGBA32F: | 16554 case GL_RGBA32F: |
16554 valid_dest_format = | 16555 valid_dest_format = |
16555 feature_info_->ext_color_buffer_float_available() || | 16556 feature_info_->ext_color_buffer_float_available() || |
16556 feature_info_->feature_flags().chromium_color_buffer_float_rgba; | 16557 feature_info_->feature_flags().chromium_color_buffer_float_rgba; |
16557 break; | 16558 break; |
16558 default: | 16559 default: |
16559 valid_dest_format = false; | 16560 valid_dest_format = false; |
16560 break; | 16561 break; |
16561 } | 16562 } |
16562 | 16563 |
| 16564 // TODO(aleksandar.stojiljkovic): Use sized internal formats: crbug.com/628064 |
16563 bool valid_source_format = | 16565 bool valid_source_format = |
16564 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || | 16566 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || |
16565 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || | 16567 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || |
16566 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 || | 16568 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 || |
16567 source_internal_format == GL_LUMINANCE || | 16569 source_internal_format == GL_LUMINANCE || |
16568 source_internal_format == GL_LUMINANCE_ALPHA || | 16570 source_internal_format == GL_LUMINANCE_ALPHA || |
16569 source_internal_format == GL_BGRA_EXT || | 16571 source_internal_format == GL_BGRA_EXT || |
16570 source_internal_format == GL_BGRA8_EXT || | 16572 source_internal_format == GL_BGRA8_EXT || |
16571 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || | 16573 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || |
16572 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; | 16574 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM || |
| 16575 source_internal_format == GL_R16_EXT; |
16573 if (!valid_source_format) { | 16576 if (!valid_source_format) { |
16574 std::string msg = "invalid source internal format " + | 16577 std::string msg = "invalid source internal format " + |
16575 GLES2Util::GetStringEnum(source_internal_format); | 16578 GLES2Util::GetStringEnum(source_internal_format); |
16576 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, | 16579 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, |
16577 msg.c_str()); | 16580 msg.c_str()); |
16578 return false; | 16581 return false; |
16579 } | 16582 } |
16580 if (!valid_dest_format) { | 16583 if (!valid_dest_format) { |
16581 std::string msg = "invalid dest internal format " + | 16584 std::string msg = "invalid dest internal format " + |
16582 GLES2Util::GetStringEnum(dest_internal_format); | 16585 GLES2Util::GetStringEnum(dest_internal_format); |
(...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19575 } | 19578 } |
19576 | 19579 |
19577 // Include the auto-generated part of this file. We split this because it means | 19580 // Include the auto-generated part of this file. We split this because it means |
19578 // we can easily edit the non-auto generated parts right here in this file | 19581 // we can easily edit the non-auto generated parts right here in this file |
19579 // instead of having to edit some template or the code generator. | 19582 // instead of having to edit some template or the code generator. |
19580 #include "base/macros.h" | 19583 #include "base/macros.h" |
19581 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19584 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19582 | 19585 |
19583 } // namespace gles2 | 19586 } // namespace gles2 |
19584 } // namespace gpu | 19587 } // namespace gpu |
OLD | NEW |