| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 enum YUVAlphaTextureMode { | 127 enum YUVAlphaTextureMode { |
| 128 YUV_ALPHA_TEXTURE_MODE_NA, | 128 YUV_ALPHA_TEXTURE_MODE_NA, |
| 129 YUV_NO_ALPHA_TEXTURE, | 129 YUV_NO_ALPHA_TEXTURE, |
| 130 YUV_HAS_ALPHA_TEXTURE, | 130 YUV_HAS_ALPHA_TEXTURE, |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 enum ColorConversionMode { | 133 enum ColorConversionMode { |
| 134 // No color conversion is performed. | 134 // No color conversion is performed. |
| 135 COLOR_CONVERSION_MODE_NONE, | 135 COLOR_CONVERSION_MODE_NONE, |
| 136 // Conversion is done directly from YUV to output RGB space, via a 3D texture | 136 // Conversion is done directly from input RGB space (or YUV space if |
| 137 // represented as a 2D texture. | 137 // applicable) to output RGB space, via a 3D texture represented as a 2D |
| 138 COLOR_CONVERSION_MODE_LUT_FROM_YUV, | 138 // texture. |
| 139 COLOR_CONVERSION_MODE_LUT, |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 // TODO(ccameron): Merge this with BlendMode. | 142 // TODO(ccameron): Merge this with BlendMode. |
| 142 enum FragColorMode { | 143 enum FragColorMode { |
| 143 FRAG_COLOR_MODE_DEFAULT, | 144 FRAG_COLOR_MODE_DEFAULT, |
| 144 FRAG_COLOR_MODE_OPAQUE, | 145 FRAG_COLOR_MODE_OPAQUE, |
| 145 FRAG_COLOR_MODE_APPLY_BLEND_MODE, | 146 FRAG_COLOR_MODE_APPLY_BLEND_MODE, |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 enum MaskMode { | 149 enum MaskMode { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 288 |
| 288 // YUV uniform locations. | 289 // YUV uniform locations. |
| 289 int y_texture_location_ = -1; | 290 int y_texture_location_ = -1; |
| 290 int u_texture_location_ = -1; | 291 int u_texture_location_ = -1; |
| 291 int v_texture_location_ = -1; | 292 int v_texture_location_ = -1; |
| 292 int uv_texture_location_ = -1; | 293 int uv_texture_location_ = -1; |
| 293 int a_texture_location_ = -1; | 294 int a_texture_location_ = -1; |
| 294 int ya_clamp_rect_location_ = -1; | 295 int ya_clamp_rect_location_ = -1; |
| 295 int uv_clamp_rect_location_ = -1; | 296 int uv_clamp_rect_location_ = -1; |
| 296 | 297 |
| 297 // Analytic YUV to RGB convertion. | 298 // This matrix will convert from the values read in the YUV texture to |
| 298 int yuv_matrix_location_ = -1; | 299 // RGB (including resource offset and scale). If we are using LUT based |
| 299 int yuv_adj_location_ = -1; | 300 // color conversion, then this will only perform resource offset and scale. |
| 301 int yuv_and_resource_matrix_location_ = -1; |
| 300 | 302 |
| 301 // LUT YUV to color-converted RGB. | 303 // LUT YUV to color-converted RGB. |
| 302 int lut_texture_location_ = -1; | 304 int lut_texture_location_ = -1; |
| 303 int lut_size_location_ = -1; | 305 int lut_size_location_ = -1; |
| 304 int resource_multiplier_location_ = -1; | |
| 305 int resource_offset_location_ = -1; | |
| 306 | 306 |
| 307 private: | 307 private: |
| 308 friend class Program; | 308 friend class Program; |
| 309 | 309 |
| 310 std::string GetHelperFunctions() const; | 310 std::string GetHelperFunctions() const; |
| 311 std::string GetBlendFunction() const; | 311 std::string GetBlendFunction() const; |
| 312 std::string GetBlendFunctionBodyForAlpha() const; | 312 std::string GetBlendFunctionBodyForAlpha() const; |
| 313 std::string GetBlendFunctionBodyForRGB() const; | 313 std::string GetBlendFunctionBodyForRGB() const; |
| 314 | 314 |
| 315 DISALLOW_COPY_AND_ASSIGN(FragmentShader); | 315 DISALLOW_COPY_AND_ASSIGN(FragmentShader); |
| 316 }; | 316 }; |
| 317 | 317 |
| 318 } // namespace cc | 318 } // namespace cc |
| 319 | 319 |
| 320 #endif // CC_OUTPUT_SHADER_H_ | 320 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |