Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: cc/output/shader.h

Issue 2122573003: media: replace LUMINANCE_F16 by RG_88 for 9/10-bit h264 videos Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve hubbe's concerns except for test. separate the CLs. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 {
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 inverse_max_input_value_location() const {
799 return inverse_max_input_value_location_;
800 }
786 int resource_multiplier_location() const { 801 int resource_multiplier_location() const {
787 return resource_multiplier_location_; 802 return resource_multiplier_location_;
788 } 803 }
789 int resource_offset_location() const { return resource_offset_location_; } 804 int resource_offset_location() const { return resource_offset_location_; }
790 805
791 private: 806 private:
792 bool use_alpha_texture_; 807 bool use_alpha_texture_;
793 bool use_nv12_; 808 bool use_nv12_;
794 bool use_color_lut_; 809 bool use_color_lut_;
810 HighbitTexture highbit_texture_ = HIGHBIT_Y8;
795 811
796 int y_texture_location_; 812 int y_texture_location_;
797 int u_texture_location_; 813 int u_texture_location_;
798 int v_texture_location_; 814 int v_texture_location_;
799 int uv_texture_location_; 815 int uv_texture_location_;
800 int a_texture_location_; 816 int a_texture_location_;
801 int lut_texture_location_; 817 int lut_texture_location_;
802 int alpha_location_; 818 int alpha_location_;
803 int yuv_matrix_location_; 819 int yuv_matrix_location_;
804 int yuv_adj_location_; 820 int yuv_adj_location_;
821 int inverse_max_input_value_location_;
822 int ya_size_location_;
823 int uv_size_location_;
805 int ya_clamp_rect_location_; 824 int ya_clamp_rect_location_;
806 int uv_clamp_rect_location_; 825 int uv_clamp_rect_location_;
807 int resource_multiplier_location_; 826 int resource_multiplier_location_;
808 int resource_offset_location_; 827 int resource_offset_location_;
809 828
810 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); 829 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo);
811 }; 830 };
812 831
813 class FragmentShaderColor : public FragmentTexBlendMode { 832 class FragmentShaderColor : public FragmentTexBlendMode {
814 public: 833 public:
(...skipping 29 matching lines...) Expand all
844 863
845 private: 864 private:
846 int color_location_; 865 int color_location_;
847 866
848 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); 867 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA);
849 }; 868 };
850 869
851 } // namespace cc 870 } // namespace cc
852 871
853 #endif // CC_OUTPUT_SHADER_H_ 872 #endif // CC_OUTPUT_SHADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698