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 #include "cc/output/shader.h" | 5 #include "cc/output/shader.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "cc/output/gl_renderer.h" // For the GLC() macro. | 11 #include "cc/output/gl_renderer.h" // For the GLC() macro. |
12 #include "gpu/command_buffer/client/gles2_interface.h" | 12 #include "gpu/command_buffer/client/gles2_interface.h" |
13 #include "third_party/khronos/GLES2/gl2.h" | |
14 | 13 |
15 #define SHADER0(Src) #Src | 14 #define SHADER0(Src) #Src |
16 #define VERTEX_SHADER(Src) SetVertexTexCoordPrecision(SHADER0(Src)) | 15 #define VERTEX_SHADER(Src) SetVertexTexCoordPrecision(SHADER0(Src)) |
17 #define FRAGMENT_SHADER(Src) SetFragmentTexCoordPrecision( \ | 16 #define FRAGMENT_SHADER(Src) SetFragmentTexCoordPrecision( \ |
18 precision, SetFragmentSamplerType(sampler, SHADER0(Src))) | 17 precision, SetFragmentSamplerType(sampler, SHADER0(Src))) |
19 | 18 |
20 using gpu::gles2::GLES2Interface; | 19 using gpu::gles2::GLES2Interface; |
21 | 20 |
22 namespace cc { | 21 namespace cc { |
23 | 22 |
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 vec2 texCoord = | 1530 vec2 texCoord = |
1532 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; | 1531 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; |
1533 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); | 1532 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); |
1534 float picker = abs(coord.x - coord.y); // NOLINT | 1533 float picker = abs(coord.x - coord.y); // NOLINT |
1535 gl_FragColor = mix(color1, color2, picker) * alpha; | 1534 gl_FragColor = mix(color1, color2, picker) * alpha; |
1536 } | 1535 } |
1537 ); // NOLINT(whitespace/parens) | 1536 ); // NOLINT(whitespace/parens) |
1538 } | 1537 } |
1539 | 1538 |
1540 } // namespace cc | 1539 } // namespace cc |
OLD | NEW |