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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 int highp_threshold_min, | 139 int highp_threshold_min, |
140 gfx::Point max_coordinate) { | 140 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 gfx::Size max_size) { | 149 const gfx::Size& max_size) { |
150 return TexCoordPrecisionRequired(context, | 150 return TexCoordPrecisionRequired(context, |
151 highp_threshold_cache, highp_threshold_min, | 151 highp_threshold_cache, highp_threshold_min, |
152 max_size.width(), max_size.height()); | 152 max_size.width(), max_size.height()); |
153 } | 153 } |
154 | 154 |
155 VertexShaderPosTex::VertexShaderPosTex() | 155 VertexShaderPosTex::VertexShaderPosTex() |
156 : matrix_location_(-1) {} | 156 : matrix_location_(-1) {} |
157 | 157 |
158 void VertexShaderPosTex::Init(GLES2Interface* context, | 158 void VertexShaderPosTex::Init(GLES2Interface* context, |
159 unsigned program, | 159 unsigned program, |
(...skipping 1369 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 |