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/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class Point; | 14 class Point; |
15 class Size; | 15 class Size; |
16 } | 16 } |
17 | 17 |
18 namespace gpu { | 18 namespace gpu { |
19 namespace gles2 { | 19 namespace gles2 { |
20 class GLES2Interface; | 20 class GLES2Interface; |
21 } | 21 } |
22 } | 22 } |
23 | 23 |
24 namespace cc { | 24 namespace cc { |
25 | 25 |
26 enum TexCoordPrecision { | 26 enum TexCoordPrecision { |
27 TEX_COORD_PRECISION_NA = 0, | 27 TexCoordPrecisionNA = 0, |
28 TEX_COORD_PRECISION_MEDIUM = 1, | 28 TexCoordPrecisionMedium = 1, |
29 TEX_COORD_PRECISION_HIGH = 2, | 29 TexCoordPrecisionHigh = 2, |
30 LAST_TEX_COORD_PRECISION = 2 | 30 NumTexCoordPrecisions = 3 |
31 }; | 31 }; |
32 | 32 |
33 enum SamplerType { | 33 enum SamplerType { |
34 SAMPLER_TYPE_NA = 0, | 34 SamplerTypeNA = 0, |
35 SAMPLER_TYPE_2D = 1, | 35 SamplerType2D = 1, |
36 SAMPLER_TYPE_2D_RECT = 2, | 36 SamplerType2DRect = 2, |
37 SAMPLER_TYPE_EXTERNAL_OES = 3, | 37 SamplerTypeExternalOES = 3, |
38 LAST_SAMPLER_TYPE = 3 | 38 NumSamplerTypes = 4 |
39 }; | 39 }; |
40 | 40 |
41 enum BlendMode { | 41 enum BlendMode { |
42 BLEND_MODE_NONE, | 42 BlendModeNone, |
43 BLEND_MODE_NORMAL, | 43 BlendModeNormal, |
44 BLEND_MODE_SCREEN, | 44 BlendModeScreen, |
45 BLEND_MODE_OVERLAY, | 45 BlendModeOverlay, |
46 BLEND_MODE_DARKEN, | 46 BlendModeDarken, |
47 BLEND_MODE_LIGHTEN, | 47 BlendModeLighten, |
48 BLEND_MODE_COLOR_DODGE, | 48 BlendModeColorDodge, |
49 BLEND_MODE_COLOR_BURN, | 49 BlendModeColorBurn, |
50 BLEND_MODE_HARD_LIGHT, | 50 BlendModeHardLight, |
51 BLEND_MODE_SOFT_LIGHT, | 51 BlendModeSoftLight, |
52 BLEND_MODE_DIFFERENCE, | 52 BlendModeDifference, |
53 BLEND_MODE_EXCLUSION, | 53 BlendModeExclusion, |
54 BLEND_MODE_MULTIPLY, | 54 BlendModeMultiply, |
55 BLEND_MODE_HUE, | 55 BlendModeHue, |
56 BLEND_MODE_SATURATION, | 56 BlendModeSaturation, |
57 BLEND_MODE_COLOR, | 57 BlendModeColor, |
58 BLEND_MODE_LUMINOSITY, | 58 BlendModeLuminosity, |
59 LAST_BLEND_MODE = BLEND_MODE_LUMINOSITY | 59 NumBlendModes |
60 }; | 60 }; |
61 | 61 |
62 // Note: The highp_threshold_cache must be provided by the caller to make | 62 // Note: The highp_threshold_cache must be provided by the caller to make |
63 // the caching multi-thread/context safe in an easy low-overhead manner. | 63 // the caching multi-thread/context safe in an easy low-overhead manner. |
64 // The caller must make sure to clear highp_threshold_cache to 0, so it can be | 64 // The caller must make sure to clear highp_threshold_cache to 0, so it can be |
65 // reinitialized, if a new or different context is used. | 65 // reinitialized, if a new or different context is used. |
66 CC_EXPORT TexCoordPrecision | 66 CC_EXPORT TexCoordPrecision |
67 TexCoordPrecisionRequired(gpu::gles2::GLES2Interface* context, | 67 TexCoordPrecisionRequired(gpu::gles2::GLES2Interface* context, |
68 int* highp_threshold_cache, | 68 int* highp_threshold_cache, |
69 int highp_threshold_min, | 69 int highp_threshold_min, |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 DISALLOW_COPY_AND_ASSIGN(VertexShaderVideoTransform); | 322 DISALLOW_COPY_AND_ASSIGN(VertexShaderVideoTransform); |
323 }; | 323 }; |
324 | 324 |
325 class FragmentTexBlendMode { | 325 class FragmentTexBlendMode { |
326 public: | 326 public: |
327 int backdrop_location() const { return backdrop_location_; } | 327 int backdrop_location() const { return backdrop_location_; } |
328 int backdrop_rect_location() const { return backdrop_rect_location_; } | 328 int backdrop_rect_location() const { return backdrop_rect_location_; } |
329 | 329 |
330 BlendMode blend_mode() const { return blend_mode_; } | 330 BlendMode blend_mode() const { return blend_mode_; } |
331 void set_blend_mode(BlendMode blend_mode) { blend_mode_ = blend_mode; } | 331 void set_blend_mode(BlendMode blend_mode) { blend_mode_ = blend_mode; } |
332 bool has_blend_mode() const { return blend_mode_ != BLEND_MODE_NONE; } | 332 bool has_blend_mode() const { return blend_mode_ != BlendModeNone; } |
333 | 333 |
334 protected: | 334 protected: |
335 FragmentTexBlendMode(); | 335 FragmentTexBlendMode(); |
336 | 336 |
337 std::string SetBlendModeFunctions(std::string shader_string) const; | 337 std::string SetBlendModeFunctions(std::string shader_string) const; |
338 | 338 |
339 int backdrop_location_; | 339 int backdrop_location_; |
340 int backdrop_rect_location_; | 340 int backdrop_rect_location_; |
341 | 341 |
342 private: | 342 private: |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 int tex_transform_location_; | 843 int tex_transform_location_; |
844 int frequency_location_; | 844 int frequency_location_; |
845 int color_location_; | 845 int color_location_; |
846 | 846 |
847 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); | 847 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); |
848 }; | 848 }; |
849 | 849 |
850 } // namespace cc | 850 } // namespace cc |
851 | 851 |
852 #endif // CC_OUTPUT_SHADER_H_ | 852 #endif // CC_OUTPUT_SHADER_H_ |
OLD | NEW |