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

Unified Diff: cc/output/shader.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/program_binding.cc ('k') | cc/output/shader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/shader.h
diff --git a/cc/output/shader.h b/cc/output/shader.h
index 6550f90118c28e4ca8c40458eb7cb6b924971ddc..e69d4f4d16e7d635431134e3445a6975d6cf8644 100644
--- a/cc/output/shader.h
+++ b/cc/output/shader.h
@@ -114,6 +114,29 @@ enum InputColorSource {
INPUT_COLOR_SOURCE_UNIFORM,
};
+enum UVTextureMode {
+ // Shader does not use YUV textures.
+ UV_TEXTURE_MODE_NA,
+ // UV plane is a single texture.
+ UV_TEXTURE_MODE_UV,
+ // U and V planes have separate textures.
+ UV_TEXTURE_MODE_U_V,
+};
+
+enum YUVAlphaTextureMode {
+ YUV_ALPHA_TEXTURE_MODE_NA,
+ YUV_NO_ALPHA_TEXTURE,
+ YUV_HAS_ALPHA_TEXTURE,
+};
+
+enum ColorConversionMode {
+ // No color conversion is performed.
+ COLOR_CONVERSION_MODE_NONE,
+ // Conversion is done directly from YUV to output RGB space, via a 3D texture
+ // represented as a 2D texture.
+ COLOR_CONVERSION_MODE_2D_LUT_AS_3D_FROM_YUV,
+};
+
// TODO(ccameron): Merge this with BlendMode.
enum FragColorMode {
FRAG_COLOR_MODE_DEFAULT,
@@ -256,9 +279,10 @@ class FragmentShader {
bool mask_for_background_ = false;
// YUV-only parameters.
- bool use_alpha_texture_ = false;
- bool use_nv12_ = false;
- bool use_color_lut_ = false;
+ YUVAlphaTextureMode yuv_alpha_texture_mode_ = YUV_ALPHA_TEXTURE_MODE_NA;
+ UVTextureMode uv_texture_mode_ = UV_TEXTURE_MODE_UV;
+
+ ColorConversionMode color_conversion_mode_ = COLOR_CONVERSION_MODE_NONE;
// YUV uniform locations.
int y_texture_location_ = -1;
« no previous file with comments | « cc/output/program_binding.cc ('k') | cc/output/shader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698