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
3 // found in the LICENSE file.
5 #ifndef CC_OUTPUT_SHADER_H_
6 #define CC_OUTPUT_SHADER_H_
10 #include "base/basictypes.h"
11 #include "cc/base/cc_export.h"
26 enum TexCoordPrecision
{
27 TEX_COORD_PRECISION_NA
= 0,
28 TEX_COORD_PRECISION_MEDIUM
= 1,
29 TEX_COORD_PRECISION_HIGH
= 2,
30 LAST_TEX_COORD_PRECISION
= 2
36 SAMPLER_TYPE_2D_RECT
= 2,
37 SAMPLER_TYPE_EXTERNAL_OES
= 3,
48 BLEND_MODE_COLOR_DODGE
,
49 BLEND_MODE_COLOR_BURN
,
50 BLEND_MODE_HARD_LIGHT
,
51 BLEND_MODE_SOFT_LIGHT
,
52 BLEND_MODE_DIFFERENCE
,
56 BLEND_MODE_SATURATION
,
58 BLEND_MODE_LUMINOSITY
,
59 LAST_BLEND_MODE
= BLEND_MODE_LUMINOSITY
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.
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.
66 CC_EXPORT TexCoordPrecision
67 TexCoordPrecisionRequired(gpu::gles2::GLES2Interface
* context
,
68 int* highp_threshold_cache
,
69 int highp_threshold_min
,
70 const gfx::Point
& max_coordinate
);
72 CC_EXPORT TexCoordPrecision
TexCoordPrecisionRequired(
73 gpu::gles2::GLES2Interface
* context
,
74 int *highp_threshold_cache
,
75 int highp_threshold_min
,
76 const gfx::Size
& max_size
);
78 class VertexShaderPosTex
{
82 void Init(gpu::gles2::GLES2Interface
* context
,
84 int* base_uniform_index
);
85 std::string
GetShaderString() const;
86 static std::string
GetShaderHead();
87 static std::string
GetShaderBody();
89 int matrix_location() const { return matrix_location_
; }
94 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTex
);
97 class VertexShaderPosTexYUVStretchOffset
{
99 VertexShaderPosTexYUVStretchOffset();
101 void Init(gpu::gles2::GLES2Interface
* context
,
103 int* base_uniform_index
);
104 std::string
GetShaderString() const;
105 static std::string
GetShaderHead();
106 static std::string
GetShaderBody();
108 int matrix_location() const { return matrix_location_
; }
109 int tex_scale_location() const { return tex_scale_location_
; }
110 int tex_offset_location() const { return tex_offset_location_
; }
113 int matrix_location_
;
114 int tex_scale_location_
;
115 int tex_offset_location_
;
117 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTexYUVStretchOffset
);
120 class VertexShaderPos
{
124 void Init(gpu::gles2::GLES2Interface
* context
,
126 int* base_uniform_index
);
127 std::string
GetShaderString() const;
128 static std::string
GetShaderHead();
129 static std::string
GetShaderBody();
131 int matrix_location() const { return matrix_location_
; }
134 int matrix_location_
;
136 DISALLOW_COPY_AND_ASSIGN(VertexShaderPos
);
139 class VertexShaderPosTexIdentity
{
141 void Init(gpu::gles2::GLES2Interface
* context
,
143 int* base_uniform_index
) {}
144 std::string
GetShaderString() const;
145 static std::string
GetShaderHead();
146 static std::string
GetShaderBody();
149 class VertexShaderPosTexTransform
{
151 VertexShaderPosTexTransform();
153 void Init(gpu::gles2::GLES2Interface
* context
,
155 int* base_uniform_index
);
156 std::string
GetShaderString() const;
157 static std::string
GetShaderHead();
158 static std::string
GetShaderBody();
160 int matrix_location() const { return matrix_location_
; }
161 int tex_transform_location() const { return tex_transform_location_
; }
162 int vertex_opacity_location() const { return vertex_opacity_location_
; }
165 int matrix_location_
;
166 int tex_transform_location_
;
167 int vertex_opacity_location_
;
169 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTexTransform
);
172 class VertexShaderQuad
{
176 void Init(gpu::gles2::GLES2Interface
* context
,
178 int* base_uniform_index
);
179 std::string
GetShaderString() const;
180 static std::string
GetShaderHead();
181 static std::string
GetShaderBody();
183 int matrix_location() const { return matrix_location_
; }
184 int viewport_location() const { return -1; }
185 int quad_location() const { return quad_location_
; }
186 int edge_location() const { return -1; }
189 int matrix_location_
;
192 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuad
);
195 class VertexShaderQuadAA
{
197 VertexShaderQuadAA();
199 void Init(gpu::gles2::GLES2Interface
* context
,
201 int* base_uniform_index
);
202 std::string
GetShaderString() const;
203 static std::string
GetShaderHead();
204 static std::string
GetShaderBody();
206 int matrix_location() const { return matrix_location_
; }
207 int viewport_location() const { return viewport_location_
; }
208 int quad_location() const { return quad_location_
; }
209 int edge_location() const { return edge_location_
; }
212 int matrix_location_
;
213 int viewport_location_
;
217 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuadAA
);
221 class VertexShaderQuadTexTransformAA
{
223 VertexShaderQuadTexTransformAA();
225 void Init(gpu::gles2::GLES2Interface
* context
,
227 int* base_uniform_index
);
228 std::string
GetShaderString() const;
229 static std::string
GetShaderHead();
230 static std::string
GetShaderBody();
232 int matrix_location() const { return matrix_location_
; }
233 int viewport_location() const { return viewport_location_
; }
234 int quad_location() const { return quad_location_
; }
235 int edge_location() const { return edge_location_
; }
236 int tex_transform_location() const { return tex_transform_location_
; }
239 int matrix_location_
;
240 int viewport_location_
;
243 int tex_transform_location_
;
245 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuadTexTransformAA
);
248 class VertexShaderTile
{
252 void Init(gpu::gles2::GLES2Interface
* context
,
254 int* base_uniform_index
);
255 std::string
GetShaderString() const;
256 static std::string
GetShaderHead();
257 static std::string
GetShaderBody();
259 int matrix_location() const { return matrix_location_
; }
260 int viewport_location() const { return -1; }
261 int quad_location() const { return quad_location_
; }
262 int edge_location() const { return -1; }
263 int vertex_tex_transform_location() const {
264 return vertex_tex_transform_location_
;
268 int matrix_location_
;
270 int vertex_tex_transform_location_
;
272 DISALLOW_COPY_AND_ASSIGN(VertexShaderTile
);
275 class VertexShaderTileAA
{
277 VertexShaderTileAA();
279 void Init(gpu::gles2::GLES2Interface
* context
,
281 int* base_uniform_index
);
282 std::string
GetShaderString() const;
283 static std::string
GetShaderHead();
284 static std::string
GetShaderBody();
286 int matrix_location() const { return matrix_location_
; }
287 int viewport_location() const { return viewport_location_
; }
288 int quad_location() const { return quad_location_
; }
289 int edge_location() const { return edge_location_
; }
290 int vertex_tex_transform_location() const {
291 return vertex_tex_transform_location_
;
295 int matrix_location_
;
296 int viewport_location_
;
299 int vertex_tex_transform_location_
;
301 DISALLOW_COPY_AND_ASSIGN(VertexShaderTileAA
);
304 class VertexShaderVideoTransform
{
306 VertexShaderVideoTransform();
308 void Init(gpu::gles2::GLES2Interface
* context
,
310 int* base_uniform_index
);
311 std::string
GetShaderString() const;
312 static std::string
GetShaderHead();
313 static std::string
GetShaderBody();
315 int matrix_location() const { return matrix_location_
; }
316 int tex_matrix_location() const { return tex_matrix_location_
; }
319 int matrix_location_
;
320 int tex_matrix_location_
;
322 DISALLOW_COPY_AND_ASSIGN(VertexShaderVideoTransform
);
325 class FragmentTexBlendMode
{
327 int backdrop_location() const { return backdrop_location_
; }
328 int backdrop_rect_location() const { return backdrop_rect_location_
; }
330 BlendMode
blend_mode() const { return 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
; }
335 FragmentTexBlendMode();
337 std::string
SetBlendModeFunctions(std::string shader_string
) const;
339 int backdrop_location_
;
340 int backdrop_rect_location_
;
343 BlendMode blend_mode_
;
345 std::string
GetHelperFunctions() const;
346 std::string
GetBlendFunction() const;
347 std::string
GetBlendFunctionBodyForRGB() const;
350 class FragmentTexAlphaBinding
: public FragmentTexBlendMode
{
352 FragmentTexAlphaBinding();
354 void Init(gpu::gles2::GLES2Interface
* context
,
356 int* base_uniform_index
);
357 int alpha_location() const { return alpha_location_
; }
358 int fragment_tex_transform_location() const { return -1; }
359 int sampler_location() const { return sampler_location_
; }
362 int sampler_location_
;
365 DISALLOW_COPY_AND_ASSIGN(FragmentTexAlphaBinding
);
368 class FragmentTexColorMatrixAlphaBinding
: public FragmentTexBlendMode
{
370 FragmentTexColorMatrixAlphaBinding();
372 void Init(gpu::gles2::GLES2Interface
* context
,
374 int* base_uniform_index
);
375 int alpha_location() const { return alpha_location_
; }
376 int color_matrix_location() const { return color_matrix_location_
; }
377 int color_offset_location() const { return color_offset_location_
; }
378 int fragment_tex_transform_location() const { return -1; }
379 int sampler_location() const { return sampler_location_
; }
382 int sampler_location_
;
384 int color_matrix_location_
;
385 int color_offset_location_
;
388 class FragmentTexOpaqueBinding
: public FragmentTexBlendMode
{
390 FragmentTexOpaqueBinding();
392 void Init(gpu::gles2::GLES2Interface
* context
,
394 int* base_uniform_index
);
395 int alpha_location() const { return -1; }
396 int fragment_tex_transform_location() const { return -1; }
397 int background_color_location() const { return -1; }
398 int sampler_location() const { return sampler_location_
; }
401 int sampler_location_
;
403 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding
);
406 class FragmentTexBackgroundBinding
: public FragmentTexBlendMode
{
408 FragmentTexBackgroundBinding();
410 void Init(gpu::gles2::GLES2Interface
* context
,
412 int* base_uniform_index
);
413 int background_color_location() const { return background_color_location_
; }
414 int sampler_location() const { return sampler_location_
; }
417 int background_color_location_
;
418 int sampler_location_
;
420 DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding
);
423 class FragmentShaderRGBATexVaryingAlpha
: public FragmentTexOpaqueBinding
{
425 std::string
GetShaderString(
426 TexCoordPrecision precision
, SamplerType sampler
) const;
427 static std::string
GetShaderHead();
428 static std::string
GetShaderBody();
431 class FragmentShaderRGBATexPremultiplyAlpha
: public FragmentTexOpaqueBinding
{
433 std::string
GetShaderString(
434 TexCoordPrecision precision
, SamplerType sampler
) const;
435 static std::string
GetShaderHead();
436 static std::string
GetShaderBody();
439 class FragmentShaderTexBackgroundVaryingAlpha
440 : public FragmentTexBackgroundBinding
{
442 std::string
GetShaderString(
443 TexCoordPrecision precision
, SamplerType sampler
) const;
444 static std::string
GetShaderHead();
445 static std::string
GetShaderBody();
448 class FragmentShaderTexBackgroundPremultiplyAlpha
449 : public FragmentTexBackgroundBinding
{
451 std::string
GetShaderString(
452 TexCoordPrecision precision
, SamplerType sampler
) const;
453 static std::string
GetShaderHead();
454 static std::string
GetShaderBody();
457 class FragmentShaderRGBATexAlpha
: public FragmentTexAlphaBinding
{
459 std::string
GetShaderString(
460 TexCoordPrecision precision
, SamplerType sampler
) const;
461 static std::string
GetShaderHead();
462 static std::string
GetShaderBody();
465 class FragmentShaderRGBATexColorMatrixAlpha
466 : public FragmentTexColorMatrixAlphaBinding
{
468 std::string
GetShaderString(TexCoordPrecision precision
,
469 SamplerType sampler
) const;
470 static std::string
GetShaderHead();
471 static std::string
GetShaderBody();
474 class FragmentShaderRGBATexOpaque
: public FragmentTexOpaqueBinding
{
476 std::string
GetShaderString(
477 TexCoordPrecision precision
, SamplerType sampler
) const;
478 static std::string
GetShaderHead();
479 static std::string
GetShaderBody();
482 class FragmentShaderRGBATex
: public FragmentTexOpaqueBinding
{
484 std::string
GetShaderString(
485 TexCoordPrecision precision
, SamplerType sampler
) const;
486 static std::string
GetShaderHead();
487 static std::string
GetShaderBody();
490 // Swizzles the red and blue component of sampled texel with alpha.
491 class FragmentShaderRGBATexSwizzleAlpha
: public FragmentTexAlphaBinding
{
493 std::string
GetShaderString(
494 TexCoordPrecision precision
, SamplerType sampler
) const;
495 static std::string
GetShaderHead();
496 static std::string
GetShaderBody();
499 // Swizzles the red and blue component of sampled texel without alpha.
500 class FragmentShaderRGBATexSwizzleOpaque
: public FragmentTexOpaqueBinding
{
502 std::string
GetShaderString(
503 TexCoordPrecision precision
, SamplerType sampler
) const;
504 static std::string
GetShaderHead();
505 static std::string
GetShaderBody();
508 class FragmentShaderRGBATexAlphaAA
: public FragmentTexBlendMode
{
510 FragmentShaderRGBATexAlphaAA();
512 void Init(gpu::gles2::GLES2Interface
* context
,
514 int* base_uniform_index
);
515 std::string
GetShaderString(
516 TexCoordPrecision precision
, SamplerType sampler
) const;
517 static std::string
GetShaderHead();
518 static std::string
GetShaderBody();
520 int alpha_location() const { return alpha_location_
; }
521 int sampler_location() const { return sampler_location_
; }
524 int sampler_location_
;
527 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaAA
);
530 class FragmentTexClampAlphaAABinding
: public FragmentTexBlendMode
{
532 FragmentTexClampAlphaAABinding();
534 void Init(gpu::gles2::GLES2Interface
* context
,
536 int* base_uniform_index
);
537 int alpha_location() const { return alpha_location_
; }
538 int sampler_location() const { return sampler_location_
; }
539 int fragment_tex_transform_location() const {
540 return fragment_tex_transform_location_
;
544 int sampler_location_
;
546 int fragment_tex_transform_location_
;
548 DISALLOW_COPY_AND_ASSIGN(FragmentTexClampAlphaAABinding
);
551 class FragmentShaderRGBATexClampAlphaAA
552 : public FragmentTexClampAlphaAABinding
{
554 std::string
GetShaderString(
555 TexCoordPrecision precision
, SamplerType sampler
) const;
556 static std::string
GetShaderHead();
557 static std::string
GetShaderBody();
560 // Swizzles the red and blue component of sampled texel.
561 class FragmentShaderRGBATexClampSwizzleAlphaAA
562 : public FragmentTexClampAlphaAABinding
{
564 std::string
GetShaderString(
565 TexCoordPrecision precision
, SamplerType sampler
) const;
566 static std::string
GetShaderHead();
567 static std::string
GetShaderBody();
570 class FragmentShaderRGBATexAlphaMask
: public FragmentTexBlendMode
{
572 FragmentShaderRGBATexAlphaMask();
573 std::string
GetShaderString(
574 TexCoordPrecision precision
, SamplerType sampler
) const;
575 static std::string
GetShaderHead();
576 static std::string
GetShaderBody();
578 void Init(gpu::gles2::GLES2Interface
* context
,
580 int* base_uniform_index
);
581 int alpha_location() const { return alpha_location_
; }
582 int sampler_location() const { return sampler_location_
; }
583 int mask_sampler_location() const { return mask_sampler_location_
; }
584 int mask_tex_coord_scale_location() const {
585 return mask_tex_coord_scale_location_
;
587 int mask_tex_coord_offset_location() const {
588 return mask_tex_coord_offset_location_
;
592 int sampler_location_
;
593 int mask_sampler_location_
;
595 int mask_tex_coord_scale_location_
;
596 int mask_tex_coord_offset_location_
;
598 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMask
);
601 class FragmentShaderRGBATexAlphaMaskAA
: public FragmentTexBlendMode
{
603 FragmentShaderRGBATexAlphaMaskAA();
604 std::string
GetShaderString(
605 TexCoordPrecision precision
, SamplerType sampler
) const;
606 static std::string
GetShaderHead();
607 static std::string
GetShaderBody();
609 void Init(gpu::gles2::GLES2Interface
* context
,
611 int* base_uniform_index
);
612 int alpha_location() const { return alpha_location_
; }
613 int sampler_location() const { return sampler_location_
; }
614 int mask_sampler_location() const { return mask_sampler_location_
; }
615 int mask_tex_coord_scale_location() const {
616 return mask_tex_coord_scale_location_
;
618 int mask_tex_coord_offset_location() const {
619 return mask_tex_coord_offset_location_
;
623 int sampler_location_
;
624 int mask_sampler_location_
;
626 int mask_tex_coord_scale_location_
;
627 int mask_tex_coord_offset_location_
;
629 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMaskAA
);
632 class FragmentShaderRGBATexAlphaMaskColorMatrixAA
633 : public FragmentTexBlendMode
{
635 FragmentShaderRGBATexAlphaMaskColorMatrixAA();
636 std::string
GetShaderString(
637 TexCoordPrecision precision
, SamplerType sampler
) const;
638 static std::string
GetShaderHead();
639 static std::string
GetShaderBody();
641 void Init(gpu::gles2::GLES2Interface
* context
,
643 int* base_uniform_index
);
644 int alpha_location() const { return alpha_location_
; }
645 int sampler_location() const { return sampler_location_
; }
646 int mask_sampler_location() const { return mask_sampler_location_
; }
647 int mask_tex_coord_scale_location() const {
648 return mask_tex_coord_scale_location_
;
650 int mask_tex_coord_offset_location() const {
651 return mask_tex_coord_offset_location_
;
653 int color_matrix_location() const { return color_matrix_location_
; }
654 int color_offset_location() const { return color_offset_location_
; }
657 int sampler_location_
;
658 int mask_sampler_location_
;
660 int mask_tex_coord_scale_location_
;
661 int mask_tex_coord_offset_location_
;
662 int color_matrix_location_
;
663 int color_offset_location_
;
666 class FragmentShaderRGBATexAlphaColorMatrixAA
: public FragmentTexBlendMode
{
668 FragmentShaderRGBATexAlphaColorMatrixAA();
669 std::string
GetShaderString(
670 TexCoordPrecision precision
, SamplerType sampler
) const;
671 static std::string
GetShaderHead();
672 static std::string
GetShaderBody();
674 void Init(gpu::gles2::GLES2Interface
* context
,
676 int* base_uniform_index
);
677 int alpha_location() const { return alpha_location_
; }
678 int sampler_location() const { return sampler_location_
; }
679 int color_matrix_location() const { return color_matrix_location_
; }
680 int color_offset_location() const { return color_offset_location_
; }
683 int sampler_location_
;
685 int color_matrix_location_
;
686 int color_offset_location_
;
689 class FragmentShaderRGBATexAlphaMaskColorMatrix
: public FragmentTexBlendMode
{
691 FragmentShaderRGBATexAlphaMaskColorMatrix();
692 std::string
GetShaderString(
693 TexCoordPrecision precision
, SamplerType sampler
) const;
694 static std::string
GetShaderHead();
695 static std::string
GetShaderBody();
697 void Init(gpu::gles2::GLES2Interface
* context
,
699 int* base_uniform_index
);
700 int alpha_location() const { return alpha_location_
; }
701 int sampler_location() const { return sampler_location_
; }
702 int mask_sampler_location() const { return mask_sampler_location_
; }
703 int mask_tex_coord_scale_location() const {
704 return mask_tex_coord_scale_location_
;
706 int mask_tex_coord_offset_location() const {
707 return mask_tex_coord_offset_location_
;
709 int color_matrix_location() const { return color_matrix_location_
; }
710 int color_offset_location() const { return color_offset_location_
; }
713 int sampler_location_
;
714 int mask_sampler_location_
;
716 int mask_tex_coord_scale_location_
;
717 int mask_tex_coord_offset_location_
;
718 int color_matrix_location_
;
719 int color_offset_location_
;
722 class FragmentShaderYUVVideo
: public FragmentTexBlendMode
{
724 FragmentShaderYUVVideo();
725 std::string
GetShaderString(
726 TexCoordPrecision precision
, SamplerType sampler
) const;
727 static std::string
GetShaderHead();
728 static std::string
GetShaderBody();
730 void Init(gpu::gles2::GLES2Interface
* context
,
732 int* base_uniform_index
);
733 int y_texture_location() const { return y_texture_location_
; }
734 int u_texture_location() const { return u_texture_location_
; }
735 int v_texture_location() const { return v_texture_location_
; }
736 int alpha_location() const { return alpha_location_
; }
737 int yuv_matrix_location() const { return yuv_matrix_location_
; }
738 int yuv_adj_location() const { return yuv_adj_location_
; }
739 int clamp_rect_location() const { return clamp_rect_location_
; }
742 int y_texture_location_
;
743 int u_texture_location_
;
744 int v_texture_location_
;
746 int yuv_matrix_location_
;
747 int yuv_adj_location_
;
748 int clamp_rect_location_
;
750 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo
);
753 class FragmentShaderYUVAVideo
: public FragmentTexBlendMode
{
755 FragmentShaderYUVAVideo();
756 std::string
GetShaderString(
757 TexCoordPrecision precision
, SamplerType sampler
) const;
758 static std::string
GetShaderHead();
759 static std::string
GetShaderBody();
761 void Init(gpu::gles2::GLES2Interface
* context
,
763 int* base_uniform_index
);
765 int y_texture_location() const { return y_texture_location_
; }
766 int u_texture_location() const { return u_texture_location_
; }
767 int v_texture_location() const { return v_texture_location_
; }
768 int a_texture_location() const { return a_texture_location_
; }
769 int alpha_location() const { return alpha_location_
; }
770 int yuv_matrix_location() const { return yuv_matrix_location_
; }
771 int yuv_adj_location() const { return yuv_adj_location_
; }
772 int clamp_rect_location() const { return clamp_rect_location_
; }
775 int y_texture_location_
;
776 int u_texture_location_
;
777 int v_texture_location_
;
778 int a_texture_location_
;
780 int yuv_matrix_location_
;
781 int yuv_adj_location_
;
782 int clamp_rect_location_
;
784 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVAVideo
);
787 class FragmentShaderColor
: public FragmentTexBlendMode
{
789 FragmentShaderColor();
790 std::string
GetShaderString(
791 TexCoordPrecision precision
, SamplerType sampler
) const;
792 static std::string
GetShaderHead();
793 static std::string
GetShaderBody();
795 void Init(gpu::gles2::GLES2Interface
* context
,
797 int* base_uniform_index
);
798 int color_location() const { return color_location_
; }
803 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColor
);
806 class FragmentShaderColorAA
: public FragmentTexBlendMode
{
808 FragmentShaderColorAA();
809 std::string
GetShaderString(
810 TexCoordPrecision precision
, SamplerType sampler
) const;
811 static std::string
GetShaderHead();
812 static std::string
GetShaderBody();
814 void Init(gpu::gles2::GLES2Interface
* context
,
816 int* base_uniform_index
);
817 int color_location() const { return color_location_
; }
822 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA
);
825 class FragmentShaderCheckerboard
: public FragmentTexBlendMode
{
827 FragmentShaderCheckerboard();
828 std::string
GetShaderString(
829 TexCoordPrecision precision
, SamplerType sampler
) const;
830 static std::string
GetShaderHead();
831 static std::string
GetShaderBody();
833 void Init(gpu::gles2::GLES2Interface
* context
,
835 int* base_uniform_index
);
836 int alpha_location() const { return alpha_location_
; }
837 int tex_transform_location() const { return tex_transform_location_
; }
838 int frequency_location() const { return frequency_location_
; }
839 int color_location() const { return color_location_
; }
843 int tex_transform_location_
;
844 int frequency_location_
;
847 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard
);
852 #endif // CC_OUTPUT_SHADER_H_