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

Unified Diff: cc/output/program_binding.cc

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/program_binding.h ('k') | cc/output/shader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/program_binding.cc
diff --git a/cc/output/program_binding.cc b/cc/output/program_binding.cc
index 70ed57090d3ef04f291f2766ffc28dfee283745d..d80ef682d8d84967f7ab46d6d96cdf80c2089010 100644
--- a/cc/output/program_binding.cc
+++ b/cc/output/program_binding.cc
@@ -27,8 +27,9 @@ bool ProgramKey::operator==(const ProgramKey& other) const {
mask_mode_ == other.mask_mode_ &&
mask_for_background_ == other.mask_for_background_ &&
has_color_matrix_ == other.has_color_matrix_ &&
- use_alpha_texture_ == other.use_alpha_texture_ &&
- use_nv12_ == other.use_nv12_ && use_color_lut_ == other.use_color_lut_;
+ yuv_alpha_texture_mode_ == other.yuv_alpha_texture_mode_ &&
+ uv_texture_mode_ == other.uv_texture_mode_ &&
+ color_conversion_mode_ == other.color_conversion_mode_;
}
// static
@@ -108,16 +109,20 @@ ProgramKey ProgramKey::VideoStream(TexCoordPrecision precision) {
// static
ProgramKey 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) {
ProgramKey result;
result.type_ = PROGRAM_TYPE_YUV_VIDEO;
result.precision_ = precision;
result.sampler_ = sampler;
- result.use_alpha_texture_ = use_alpha_texture;
- result.use_nv12_ = use_nv12;
- result.use_color_lut_ = use_color_lut;
+ result.yuv_alpha_texture_mode_ = yuv_alpha_texture_mode;
+ DCHECK(yuv_alpha_texture_mode == YUV_NO_ALPHA_TEXTURE ||
+ yuv_alpha_texture_mode == YUV_HAS_ALPHA_TEXTURE);
+ result.uv_texture_mode_ = uv_texture_mode;
+ DCHECK(uv_texture_mode == UV_TEXTURE_MODE_UV ||
+ uv_texture_mode == UV_TEXTURE_MODE_U_V);
+ result.color_conversion_mode_ = color_conversion_mode;
return result;
}
« no previous file with comments | « cc/output/program_binding.h ('k') | cc/output/shader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698