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

Unified Diff: cc/output/program_binding.h

Issue 2628183002: The great shader refactor: Add YUV support to the uber shader (Closed)
Patch Set: Rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/gl_renderer_unittest.cc ('k') | cc/output/program_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/program_binding.h
diff --git a/cc/output/program_binding.h b/cc/output/program_binding.h
index a95587f8554a0e49509b2356b01d9107f3a05208..e8cfe6815d8c2d6b23c62035235067985dd1fc0a 100644
--- a/cc/output/program_binding.h
+++ b/cc/output/program_binding.h
@@ -92,9 +92,9 @@ class CC_EXPORT ProgramKey {
static ProgramKey VideoStream(TexCoordPrecision precision);
static ProgramKey YUVVideo(TexCoordPrecision precision,
SamplerType sampler,
- bool use_alpha_texture,
- bool use_nv12,
- bool use_color_lut);
+ YUVAlphaTextureMode yuv_alpha_texture_mode,
+ UVTextureMode uv_texture_mode,
+ ColorConversionMode color_conversion_mode);
bool operator==(const ProgramKey& other) const;
@@ -118,9 +118,10 @@ class CC_EXPORT ProgramKey {
bool mask_for_background_ = false;
bool has_color_matrix_ = false;
- bool use_alpha_texture_ = false;
- bool use_nv12_ = false;
- bool use_color_lut_ = false;
+ YUVAlphaTextureMode yuv_alpha_texture_mode_ = YUV_NO_ALPHA_TEXTURE;
+ UVTextureMode uv_texture_mode_ = UV_TEXTURE_MODE_NA;
+
+ ColorConversionMode color_conversion_mode_ = COLOR_CONVERSION_MODE_NONE;
};
struct ProgramKeyHash {
@@ -137,9 +138,9 @@ struct ProgramKeyHash {
(static_cast<size_t>(key.mask_mode_) << 21) ^
(static_cast<size_t>(key.mask_for_background_) << 22) ^
(static_cast<size_t>(key.has_color_matrix_) << 23) ^
- (static_cast<size_t>(key.use_alpha_texture_) << 24) ^
- (static_cast<size_t>(key.use_nv12_) << 25) ^
- (static_cast<size_t>(key.use_color_lut_) << 26);
+ (static_cast<size_t>(key.yuv_alpha_texture_mode_) << 24) ^
+ (static_cast<size_t>(key.uv_texture_mode_) << 25) ^
+ (static_cast<size_t>(key.color_conversion_mode_) << 26);
}
};
@@ -384,9 +385,10 @@ class Program : public ProgramBindingBase {
vertex_shader_.is_ya_uv_ = true;
fragment_shader_.input_color_type_ = INPUT_COLOR_SOURCE_YUV_TEXTURES;
- fragment_shader_.use_alpha_texture_ = key.use_alpha_texture_;
- fragment_shader_.use_nv12_ = key.use_nv12_;
- fragment_shader_.use_color_lut_ = key.use_color_lut_;
+ fragment_shader_.has_uniform_alpha_ = true;
+ fragment_shader_.yuv_alpha_texture_mode_ = key.yuv_alpha_texture_mode_;
+ fragment_shader_.uv_texture_mode_ = key.uv_texture_mode_;
+ fragment_shader_.color_conversion_mode_ = key.color_conversion_mode_;
}
void InitializeInternal(ContextProvider* context_provider) {
« no previous file with comments | « cc/output/gl_renderer_unittest.cc ('k') | cc/output/program_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698