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" |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1590 uniform float alpha; | 1590 uniform float alpha; |
1591 uniform float frequency; | 1591 uniform float frequency; |
1592 uniform vec4 texTransform; | 1592 uniform vec4 texTransform; |
1593 uniform vec4 color; | 1593 uniform vec4 color; |
1594 void main() { | 1594 void main() { |
1595 vec4 color1 = vec4(1.0, 1.0, 1.0, 1.0); | 1595 vec4 color1 = vec4(1.0, 1.0, 1.0, 1.0); |
1596 vec4 color2 = color; | 1596 vec4 color2 = color; |
1597 vec2 texCoord = | 1597 vec2 texCoord = |
1598 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; | 1598 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; |
1599 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); | 1599 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); |
1600 float picker = abs(coord.x - coord.y); | 1600 float picker = abs(coord.x - coord.y); // NOLINT |
enne (OOO)
2013/09/05 01:00:40
optional style nit: two spaces before the comment
| |
1601 gl_FragColor = mix(color1, color2, picker) * alpha; | 1601 gl_FragColor = mix(color1, color2, picker) * alpha; |
1602 } | 1602 } |
1603 ); // NOLINT(whitespace/parens) | 1603 ); // NOLINT(whitespace/parens) |
1604 } | 1604 } |
1605 | 1605 |
1606 } // namespace cc | 1606 } // namespace cc |
OLD | NEW |