Chromium Code Reviews| 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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 756 int mask_sampler_location_; | 756 int mask_sampler_location_; |
| 757 int alpha_location_; | 757 int alpha_location_; |
| 758 int mask_tex_coord_scale_location_; | 758 int mask_tex_coord_scale_location_; |
| 759 int mask_tex_coord_offset_location_; | 759 int mask_tex_coord_offset_location_; |
| 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 enum HighbitTexture { | |
|
hubbe
2016/09/27 20:49:51
There is no need for three values here, because th
dshwang
2016/09/28 10:33:27
|resource_multiplier_location| and |resource_offse
hubbe
2016/09/28 17:57:44
True I suppose. But you'll need the resource_multi
dshwang
2016/09/29 18:52:28
no, RG88 don't need it.
| |
| 767 HIGHBIT_Y8 = 0, // either RED_8 or LUMINANCE_8 | |
| 768 HIGHBIT_LUMINANCE_F16 = 1, | |
| 769 HIGHBIT_RG88 = 2, | |
| 770 LAST_HIGHBIT_TEXTURE = HIGHBIT_RG88 | |
| 771 }; | |
| 772 | |
| 766 FragmentShaderYUVVideo(); | 773 FragmentShaderYUVVideo(); |
| 767 std::string GetShaderString( | 774 std::string GetShaderString( |
| 768 TexCoordPrecision precision, SamplerType sampler) const; | 775 TexCoordPrecision precision, SamplerType sampler) const; |
| 769 | 776 |
| 770 void SetFeatures(bool use_alpha_texture, bool use_nv12, bool use_color_lut); | 777 void SetFeatures(bool use_alpha_texture, |
| 778 bool use_nv12, | |
| 779 bool use_color_lut, | |
| 780 HighbitTexture highbit_texture); | |
| 771 | 781 |
| 772 void Init(gpu::gles2::GLES2Interface* context, | 782 void Init(gpu::gles2::GLES2Interface* context, |
| 773 unsigned program, | 783 unsigned program, |
| 774 int* base_uniform_index); | 784 int* base_uniform_index); |
| 775 int y_texture_location() const { return y_texture_location_; } | 785 int y_texture_location() const { return y_texture_location_; } |
| 776 int u_texture_location() const { return u_texture_location_; } | 786 int u_texture_location() const { return u_texture_location_; } |
| 777 int v_texture_location() const { return v_texture_location_; } | 787 int v_texture_location() const { return v_texture_location_; } |
| 778 int uv_texture_location() const { return uv_texture_location_; } | 788 int uv_texture_location() const { return uv_texture_location_; } |
| 779 int a_texture_location() const { return a_texture_location_; } | 789 int a_texture_location() const { return a_texture_location_; } |
| 780 int lut_texture_location() const { return lut_texture_location_; } | 790 int lut_texture_location() const { return lut_texture_location_; } |
| 781 int alpha_location() const { return alpha_location_; } | 791 int alpha_location() const { return alpha_location_; } |
| 782 int yuv_matrix_location() const { return yuv_matrix_location_; } | 792 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 783 int yuv_adj_location() const { return yuv_adj_location_; } | 793 int yuv_adj_location() const { return yuv_adj_location_; } |
| 794 int ya_size_location() const { return ya_size_location_; } | |
| 795 int uv_size_location() const { return uv_size_location_; } | |
| 784 int ya_clamp_rect_location() const { return ya_clamp_rect_location_; } | 796 int ya_clamp_rect_location() const { return ya_clamp_rect_location_; } |
| 785 int uv_clamp_rect_location() const { return uv_clamp_rect_location_; } | 797 int uv_clamp_rect_location() const { return uv_clamp_rect_location_; } |
| 798 int max_channel_value_location() const { return max_channel_value_location_; } | |
| 786 int resource_multiplier_location() const { | 799 int resource_multiplier_location() const { |
| 787 return resource_multiplier_location_; | 800 return resource_multiplier_location_; |
| 788 } | 801 } |
| 789 int resource_offset_location() const { return resource_offset_location_; } | 802 int resource_offset_location() const { return resource_offset_location_; } |
| 790 | 803 |
| 791 private: | 804 private: |
| 792 bool use_alpha_texture_; | 805 bool use_alpha_texture_; |
| 793 bool use_nv12_; | 806 bool use_nv12_; |
| 794 bool use_color_lut_; | 807 bool use_color_lut_; |
| 808 bool highbit_texture_ = HIGHBIT_Y8; | |
| 795 | 809 |
| 796 int y_texture_location_; | 810 int y_texture_location_; |
| 797 int u_texture_location_; | 811 int u_texture_location_; |
| 798 int v_texture_location_; | 812 int v_texture_location_; |
| 799 int uv_texture_location_; | 813 int uv_texture_location_; |
| 800 int a_texture_location_; | 814 int a_texture_location_; |
| 801 int lut_texture_location_; | 815 int lut_texture_location_; |
| 802 int alpha_location_; | 816 int alpha_location_; |
| 803 int yuv_matrix_location_; | 817 int yuv_matrix_location_; |
| 804 int yuv_adj_location_; | 818 int yuv_adj_location_; |
| 819 int max_channel_value_location_; | |
| 820 int ya_size_location_; | |
| 821 int uv_size_location_; | |
| 805 int ya_clamp_rect_location_; | 822 int ya_clamp_rect_location_; |
| 806 int uv_clamp_rect_location_; | 823 int uv_clamp_rect_location_; |
| 807 int resource_multiplier_location_; | 824 int resource_multiplier_location_; |
| 808 int resource_offset_location_; | 825 int resource_offset_location_; |
| 809 | 826 |
| 810 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); | 827 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); |
| 811 }; | 828 }; |
| 812 | 829 |
| 813 class FragmentShaderColor : public FragmentTexBlendMode { | 830 class FragmentShaderColor : public FragmentTexBlendMode { |
| 814 public: | 831 public: |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 844 | 861 |
| 845 private: | 862 private: |
| 846 int color_location_; | 863 int color_location_; |
| 847 | 864 |
| 848 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); | 865 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); |
| 849 }; | 866 }; |
| 850 | 867 |
| 851 } // namespace cc | 868 } // namespace cc |
| 852 | 869 |
| 853 #endif // CC_OUTPUT_SHADER_H_ | 870 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |