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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 uniform mat4 matrix; | 745 uniform mat4 matrix; |
746 uniform TexCoordPrecision mat4 texMatrix; | 746 uniform TexCoordPrecision mat4 texMatrix; |
747 varying TexCoordPrecision vec2 v_texCoord; | 747 varying TexCoordPrecision vec2 v_texCoord; |
748 }); | 748 }); |
749 } | 749 } |
750 | 750 |
751 std::string VertexShaderVideoTransform::GetShaderBody() { | 751 std::string VertexShaderVideoTransform::GetShaderBody() { |
752 return SHADER0([]() { | 752 return SHADER0([]() { |
753 void main() { | 753 void main() { |
754 gl_Position = matrix * a_position; | 754 gl_Position = matrix * a_position; |
755 v_texCoord = (texMatrix * vec4(a_texCoord.xy, 0.0, 1.0)).xy; | 755 v_texCoord = |
| 756 vec2(texMatrix * vec4(a_texCoord.x, 1.0 - a_texCoord.y, 0.0, 1.0)); |
756 } | 757 } |
757 }); | 758 }); |
758 } | 759 } |
759 | 760 |
760 #define BLEND_MODE_UNIFORMS "s_backdropTexture", \ | 761 #define BLEND_MODE_UNIFORMS "s_backdropTexture", \ |
761 "s_originalBackdropTexture", \ | 762 "s_originalBackdropTexture", \ |
762 "backdropRect" | 763 "backdropRect" |
763 #define UNUSED_BLEND_MODE_UNIFORMS (!has_blend_mode() ? 3 : 0) | 764 #define UNUSED_BLEND_MODE_UNIFORMS (!has_blend_mode() ? 3 : 0) |
764 #define BLEND_MODE_SET_LOCATIONS(X, POS) \ | 765 #define BLEND_MODE_SET_LOCATIONS(X, POS) \ |
765 if (has_blend_mode()) { \ | 766 if (has_blend_mode()) { \ |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 void main() { | 2204 void main() { |
2204 vec4 d4 = min(edge_dist[0], edge_dist[1]); | 2205 vec4 d4 = min(edge_dist[0], edge_dist[1]); |
2205 vec2 d2 = min(d4.xz, d4.yw); | 2206 vec2 d2 = min(d4.xz, d4.yw); |
2206 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); | 2207 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); |
2207 gl_FragColor = color * aa; | 2208 gl_FragColor = color * aa; |
2208 } | 2209 } |
2209 }); | 2210 }); |
2210 } | 2211 } |
2211 | 2212 |
2212 } // namespace cc | 2213 } // namespace cc |
OLD | NEW |