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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 default: | 128 default: |
129 NOTREACHED(); | 129 NOTREACHED(); |
130 break; | 130 break; |
131 } | 131 } |
132 return shader_string; | 132 return shader_string; |
133 } | 133 } |
134 | 134 |
135 } // namespace | 135 } // namespace |
136 | 136 |
137 TexCoordPrecision TexCoordPrecisionRequired(GLES2Interface* context, | 137 TexCoordPrecision TexCoordPrecisionRequired(GLES2Interface* context, |
138 int *highp_threshold_cache, | 138 int* highp_threshold_cache, |
139 int highp_threshold_min, | 139 int highp_threshold_min, |
140 gfx::Point max_coordinate) { | 140 const gfx::Point& max_coordinate) { |
141 return TexCoordPrecisionRequired(context, | 141 return TexCoordPrecisionRequired(context, |
142 highp_threshold_cache, highp_threshold_min, | 142 highp_threshold_cache, highp_threshold_min, |
143 max_coordinate.x(), max_coordinate.y()); | 143 max_coordinate.x(), max_coordinate.y()); |
144 } | 144 } |
145 | 145 |
146 TexCoordPrecision TexCoordPrecisionRequired(GLES2Interface* context, | 146 TexCoordPrecision TexCoordPrecisionRequired(GLES2Interface* context, |
147 int *highp_threshold_cache, | 147 int *highp_threshold_cache, |
148 int highp_threshold_min, | 148 int highp_threshold_min, |
149 const gfx::Size& max_size) { | 149 const gfx::Size& max_size) { |
150 return TexCoordPrecisionRequired(context, | 150 return TexCoordPrecisionRequired(context, |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 vec2 texCoord = | 1529 vec2 texCoord = |
1530 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; | 1530 clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texTransform.xy; |
1531 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); | 1531 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); |
1532 float picker = abs(coord.x - coord.y); // NOLINT | 1532 float picker = abs(coord.x - coord.y); // NOLINT |
1533 gl_FragColor = mix(color1, color2, picker) * alpha; | 1533 gl_FragColor = mix(color1, color2, picker) * alpha; |
1534 } | 1534 } |
1535 ); // NOLINT(whitespace/parens) | 1535 ); // NOLINT(whitespace/parens) |
1536 } | 1536 } |
1537 | 1537 |
1538 } // namespace cc | 1538 } // namespace cc |
OLD | NEW |