| 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); | 770 void SetFeatures(bool use_alpha_texture, bool use_nv12, bool use_color_lut); |
| 771 | 771 |
| 772 void Init(gpu::gles2::GLES2Interface* context, | 772 void Init(gpu::gles2::GLES2Interface* context, |
| 773 unsigned program, | 773 unsigned program, |
| 774 int* base_uniform_index); | 774 int* base_uniform_index); |
| 775 int y_texture_location() const { return y_texture_location_; } | 775 int y_texture_location() const { return y_texture_location_; } |
| 776 int u_texture_location() const { return u_texture_location_; } | 776 int u_texture_location() const { return u_texture_location_; } |
| 777 int v_texture_location() const { return v_texture_location_; } | 777 int v_texture_location() const { return v_texture_location_; } |
| 778 int uv_texture_location() const { return uv_texture_location_; } | 778 int uv_texture_location() const { return uv_texture_location_; } |
| 779 int a_texture_location() const { return a_texture_location_; } | 779 int a_texture_location() const { return a_texture_location_; } |
| 780 int lut_texture_location() const { return lut_texture_location_; } |
| 780 int alpha_location() const { return alpha_location_; } | 781 int alpha_location() const { return alpha_location_; } |
| 781 int yuv_matrix_location() const { return yuv_matrix_location_; } | 782 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 782 int yuv_adj_location() const { return yuv_adj_location_; } | 783 int yuv_adj_location() const { return yuv_adj_location_; } |
| 783 int ya_clamp_rect_location() const { return ya_clamp_rect_location_; } | 784 int ya_clamp_rect_location() const { return ya_clamp_rect_location_; } |
| 784 int uv_clamp_rect_location() const { return uv_clamp_rect_location_; } | 785 int uv_clamp_rect_location() const { return uv_clamp_rect_location_; } |
| 786 int resource_multiplier_location() const { |
| 787 return resource_multiplier_location_; |
| 788 } |
| 789 int resource_offset_location() const { return resource_offset_location_; } |
| 785 | 790 |
| 786 private: | 791 private: |
| 787 bool use_alpha_texture_; | 792 bool use_alpha_texture_; |
| 788 bool use_nv12_; | 793 bool use_nv12_; |
| 794 bool use_color_lut_; |
| 789 | 795 |
| 790 int y_texture_location_; | 796 int y_texture_location_; |
| 791 int u_texture_location_; | 797 int u_texture_location_; |
| 792 int v_texture_location_; | 798 int v_texture_location_; |
| 793 int uv_texture_location_; | 799 int uv_texture_location_; |
| 794 int a_texture_location_; | 800 int a_texture_location_; |
| 801 int lut_texture_location_; |
| 795 int alpha_location_; | 802 int alpha_location_; |
| 796 int yuv_matrix_location_; | 803 int yuv_matrix_location_; |
| 797 int yuv_adj_location_; | 804 int yuv_adj_location_; |
| 798 int ya_clamp_rect_location_; | 805 int ya_clamp_rect_location_; |
| 799 int uv_clamp_rect_location_; | 806 int uv_clamp_rect_location_; |
| 807 int resource_multiplier_location_; |
| 808 int resource_offset_location_; |
| 800 | 809 |
| 801 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); | 810 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); |
| 802 }; | 811 }; |
| 803 | 812 |
| 804 class FragmentShaderColor : public FragmentTexBlendMode { | 813 class FragmentShaderColor : public FragmentTexBlendMode { |
| 805 public: | 814 public: |
| 806 FragmentShaderColor(); | 815 FragmentShaderColor(); |
| 807 std::string GetShaderString( | 816 std::string GetShaderString( |
| 808 TexCoordPrecision precision, SamplerType sampler) const; | 817 TexCoordPrecision precision, SamplerType sampler) const; |
| 809 static std::string GetShaderHead(); | 818 static std::string GetShaderHead(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 835 | 844 |
| 836 private: | 845 private: |
| 837 int color_location_; | 846 int color_location_; |
| 838 | 847 |
| 839 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); | 848 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); |
| 840 }; | 849 }; |
| 841 | 850 |
| 842 } // namespace cc | 851 } // namespace cc |
| 843 | 852 |
| 844 #endif // CC_OUTPUT_SHADER_H_ | 853 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |