| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_OUTPUT_SHADER_H_ | 5 #ifndef CC_OUTPUT_SHADER_H_ |
| 6 #define CC_OUTPUT_SHADER_H_ | 6 #define CC_OUTPUT_SHADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 int color_matrix_location_; | 760 int color_matrix_location_; |
| 761 int color_offset_location_; | 761 int color_offset_location_; |
| 762 }; | 762 }; |
| 763 | 763 |
| 764 class FragmentShaderYUVVideo : public FragmentTexBlendMode { | 764 class FragmentShaderYUVVideo : public FragmentTexBlendMode { |
| 765 public: | 765 public: |
| 766 FragmentShaderYUVVideo(); | 766 FragmentShaderYUVVideo(); |
| 767 std::string GetShaderString( | 767 std::string GetShaderString( |
| 768 TexCoordPrecision precision, SamplerType sampler) const; | 768 TexCoordPrecision precision, SamplerType sampler) const; |
| 769 | 769 |
| 770 void SetFeatures(bool use_alpha_texture, bool use_nv12, bool use_color_lut); | 770 void SetFeatures(SamplerType sampler, |
| 771 bool use_alpha_texture, |
| 772 bool use_nv12, |
| 773 bool use_color_lut); |
| 771 | 774 |
| 772 void Init(gpu::gles2::GLES2Interface* context, | 775 void Init(gpu::gles2::GLES2Interface* context, |
| 773 unsigned program, | 776 unsigned program, |
| 774 int* base_uniform_index); | 777 int* base_uniform_index); |
| 775 int y_texture_location() const { return y_texture_location_; } | 778 int y_texture_location() const { return y_texture_location_; } |
| 776 int u_texture_location() const { return u_texture_location_; } | 779 int u_texture_location() const { return u_texture_location_; } |
| 777 int v_texture_location() const { return v_texture_location_; } | 780 int v_texture_location() const { return v_texture_location_; } |
| 778 int uv_texture_location() const { return uv_texture_location_; } | 781 int uv_texture_location() const { return uv_texture_location_; } |
| 779 int a_texture_location() const { return a_texture_location_; } | 782 int a_texture_location() const { return a_texture_location_; } |
| 780 int lut_texture_location() const { return lut_texture_location_; } | 783 int lut_texture_location() const { return lut_texture_location_; } |
| 781 int alpha_location() const { return alpha_location_; } | 784 int alpha_location() const { return alpha_location_; } |
| 782 int yuv_matrix_location() const { return yuv_matrix_location_; } | 785 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 783 int yuv_adj_location() const { return yuv_adj_location_; } | 786 int yuv_adj_location() const { return yuv_adj_location_; } |
| 787 int ya_size_location() const { return ya_size_location_; } |
| 788 int uv_subsampling_factor_location() const { |
| 789 return uv_subsampling_factor_location_; |
| 790 } |
| 784 int ya_clamp_rect_location() const { return ya_clamp_rect_location_; } | 791 int ya_clamp_rect_location() const { return ya_clamp_rect_location_; } |
| 785 int uv_clamp_rect_location() const { return uv_clamp_rect_location_; } | 792 int uv_clamp_rect_location() const { return uv_clamp_rect_location_; } |
| 786 int resource_multiplier_location() const { | 793 int resource_multiplier_location() const { |
| 787 return resource_multiplier_location_; | 794 return resource_multiplier_location_; |
| 788 } | 795 } |
| 789 int resource_offset_location() const { return resource_offset_location_; } | 796 int resource_offset_location() const { return resource_offset_location_; } |
| 790 | 797 |
| 791 private: | 798 private: |
| 799 SamplerType sampler_ = SAMPLER_TYPE_2D; |
| 792 bool use_alpha_texture_; | 800 bool use_alpha_texture_; |
| 793 bool use_nv12_; | 801 bool use_nv12_; |
| 794 bool use_color_lut_; | 802 bool use_color_lut_; |
| 795 | 803 |
| 796 int y_texture_location_; | 804 int y_texture_location_; |
| 797 int u_texture_location_; | 805 int u_texture_location_; |
| 798 int v_texture_location_; | 806 int v_texture_location_; |
| 799 int uv_texture_location_; | 807 int uv_texture_location_; |
| 800 int a_texture_location_; | 808 int a_texture_location_; |
| 801 int lut_texture_location_; | 809 int lut_texture_location_; |
| 802 int alpha_location_; | 810 int alpha_location_; |
| 803 int yuv_matrix_location_; | 811 int yuv_matrix_location_; |
| 804 int yuv_adj_location_; | 812 int yuv_adj_location_; |
| 813 int ya_size_location_ = -1; |
| 814 int uv_subsampling_factor_location_ = -1; |
| 805 int ya_clamp_rect_location_; | 815 int ya_clamp_rect_location_; |
| 806 int uv_clamp_rect_location_; | 816 int uv_clamp_rect_location_; |
| 807 int resource_multiplier_location_; | 817 int resource_multiplier_location_; |
| 808 int resource_offset_location_; | 818 int resource_offset_location_; |
| 809 | 819 |
| 810 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); | 820 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); |
| 811 }; | 821 }; |
| 812 | 822 |
| 813 class FragmentShaderColor : public FragmentTexBlendMode { | 823 class FragmentShaderColor : public FragmentTexBlendMode { |
| 814 public: | 824 public: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 844 | 854 |
| 845 private: | 855 private: |
| 846 int color_location_; | 856 int color_location_; |
| 847 | 857 |
| 848 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); | 858 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); |
| 849 }; | 859 }; |
| 850 | 860 |
| 851 } // namespace cc | 861 } // namespace cc |
| 852 | 862 |
| 853 #endif // CC_OUTPUT_SHADER_H_ | 863 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |