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 "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 12 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
13 #include "third_party/khronos/GLES2/gl2.h" | 13 #include "third_party/khronos/GLES2/gl2.h" |
14 | 14 |
15 #define SHADER0(Src) #Src | 15 #define SHADER0(Src) #Src |
16 #define VERTEX_SHADER(Src) SetVertexTexCoordPrecision(SHADER0(Src)) | 16 #define VERTEX_SHADER(Src) SetVertexTexCoordPrecision(SHADER0(Src)) |
17 #define FRAGMENT_SHADER(Src) SetFragTexCoordPrecision(precision, SHADER0(Src)) | 17 #define FRAGMENT_SHADER(Src) SetFragTexCoordPrecision(precision, SHADER0(Src)) |
18 | 18 |
19 using WebKit::WebGraphicsContext3D; | 19 using WebKit::WebGraphicsContext3D; |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 | 22 |
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 vec2 texCoord = | 1493 vec2 texCoord = |
1494 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; | 1494 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; |
1495 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); | 1495 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); |
1496 float picker = abs(coord.x - coord.y); | 1496 float picker = abs(coord.x - coord.y); |
1497 gl_FragColor = mix(color1, color2, picker) * alpha; | 1497 gl_FragColor = mix(color1, color2, picker) * alpha; |
1498 } | 1498 } |
1499 ); // NOLINT(whitespace/parens) | 1499 ); // NOLINT(whitespace/parens) |
1500 } | 1500 } |
1501 | 1501 |
1502 } // namespace cc | 1502 } // namespace cc |
OLD | NEW |