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

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

Issue 2645953007: cc: Add analytic color conversion to shaders (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « cc/output/program_binding.h ('k') | cc/output/shader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/logging.h" 10 #include "base/logging.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 enum YUVAlphaTextureMode { 126 enum YUVAlphaTextureMode {
127 YUV_ALPHA_TEXTURE_MODE_NA, 127 YUV_ALPHA_TEXTURE_MODE_NA,
128 YUV_NO_ALPHA_TEXTURE, 128 YUV_NO_ALPHA_TEXTURE,
129 YUV_HAS_ALPHA_TEXTURE, 129 YUV_HAS_ALPHA_TEXTURE,
130 }; 130 };
131 131
132 enum ColorConversionMode { 132 enum ColorConversionMode {
133 // No color conversion is performed. 133 // No color conversion is performed.
134 COLOR_CONVERSION_MODE_NONE, 134 COLOR_CONVERSION_MODE_NONE,
135 // Conversion is done using analytic transfer functions as specified by
136 // SkColorSpaceTransferFn in a uniform array.
137 COLOR_CONVERSION_MODE_ANALYTIC,
135 // Conversion is done directly from YUV to output RGB space, via a 3D texture 138 // Conversion is done directly from YUV to output RGB space, via a 3D texture
136 // represented as a 2D texture. 139 // represented as a 2D texture.
137 COLOR_CONVERSION_MODE_LUT_FROM_YUV, 140 COLOR_CONVERSION_MODE_LUT_FROM_YUV,
138 }; 141 };
139 142
140 // TODO(ccameron): Merge this with BlendMode. 143 // TODO(ccameron): Merge this with BlendMode.
141 enum FragColorMode { 144 enum FragColorMode {
142 FRAG_COLOR_MODE_DEFAULT, 145 FRAG_COLOR_MODE_DEFAULT,
143 FRAG_COLOR_MODE_OPAQUE, 146 FRAG_COLOR_MODE_OPAQUE,
144 FRAG_COLOR_MODE_APPLY_BLEND_MODE, 147 FRAG_COLOR_MODE_APPLY_BLEND_MODE,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 SamplerType sampler_type_ = SAMPLER_TYPE_NA; 279 SamplerType sampler_type_ = SAMPLER_TYPE_NA;
277 280
278 BlendMode blend_mode_ = BLEND_MODE_NONE; 281 BlendMode blend_mode_ = BLEND_MODE_NONE;
279 bool mask_for_background_ = false; 282 bool mask_for_background_ = false;
280 283
281 // YUV-only parameters. 284 // YUV-only parameters.
282 YUVAlphaTextureMode yuv_alpha_texture_mode_ = YUV_ALPHA_TEXTURE_MODE_NA; 285 YUVAlphaTextureMode yuv_alpha_texture_mode_ = YUV_ALPHA_TEXTURE_MODE_NA;
283 UVTextureMode uv_texture_mode_ = UV_TEXTURE_MODE_UV; 286 UVTextureMode uv_texture_mode_ = UV_TEXTURE_MODE_UV;
284 287
285 ColorConversionMode color_conversion_mode_ = COLOR_CONVERSION_MODE_NONE; 288 ColorConversionMode color_conversion_mode_ = COLOR_CONVERSION_MODE_NONE;
289 int color_src_to_dst_primary_matrix_location_ = -1;
290 int color_src_to_linear_tr_fn_location_ = -1;
291 int color_linear_to_dst_tr_fn_location_ = -1;
286 292
287 // YUV uniform locations. 293 // YUV uniform locations.
288 int y_texture_location_ = -1; 294 int y_texture_location_ = -1;
289 int u_texture_location_ = -1; 295 int u_texture_location_ = -1;
290 int v_texture_location_ = -1; 296 int v_texture_location_ = -1;
291 int uv_texture_location_ = -1; 297 int uv_texture_location_ = -1;
292 int a_texture_location_ = -1; 298 int a_texture_location_ = -1;
293 int ya_clamp_rect_location_ = -1; 299 int ya_clamp_rect_location_ = -1;
294 int uv_clamp_rect_location_ = -1; 300 int uv_clamp_rect_location_ = -1;
295 301
(...skipping 13 matching lines...) Expand all
309 std::string GetHelperFunctions() const; 315 std::string GetHelperFunctions() const;
310 std::string GetBlendFunction() const; 316 std::string GetBlendFunction() const;
311 std::string GetBlendFunctionBodyForRGB() const; 317 std::string GetBlendFunctionBodyForRGB() const;
312 318
313 DISALLOW_COPY_AND_ASSIGN(FragmentShader); 319 DISALLOW_COPY_AND_ASSIGN(FragmentShader);
314 }; 320 };
315 321
316 } // namespace cc 322 } // namespace cc
317 323
318 #endif // CC_OUTPUT_SHADER_H_ 324 #endif // CC_OUTPUT_SHADER_H_
OLDNEW
« no previous file with comments | « cc/output/program_binding.h ('k') | cc/output/shader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698