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 TexCoordPrecision mat4 texMatrix; | 745 uniform TexCoordPrecision mat4 texMatrix; |
746 varying TexCoordPrecision vec2 v_texCoord; | 746 varying TexCoordPrecision vec2 v_texCoord; |
747 }); | 747 }); |
748 } | 748 } |
749 | 749 |
750 std::string VertexShaderVideoTransform::GetShaderBody() { | 750 std::string VertexShaderVideoTransform::GetShaderBody() { |
751 return SHADER0([]() { | 751 return SHADER0([]() { |
752 void main() { | 752 void main() { |
753 gl_Position = matrix * a_position; | 753 gl_Position = matrix * a_position; |
754 v_texCoord = | 754 v_texCoord = |
755 vec2(texMatrix * vec4(a_texCoord.x, 1.0 - a_texCoord.y, 0.0, 1.0)); | 755 vec2(0.0, 1.0) + |
756 vec2(1.0, -1.0) * (texMatrix * vec4(a_texCoord.xy, 0.0, 1.0)).xy; | |
liberato (no reviews please)
2016/03/31 15:03:16
is this different?
Tobias Sargeant
2016/04/01 11:59:10
It was different (y flip before matrix multiplicat
| |
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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2246 void main() { | 2247 void main() { |
2247 vec4 d4 = min(edge_dist[0], edge_dist[1]); | 2248 vec4 d4 = min(edge_dist[0], edge_dist[1]); |
2248 vec2 d2 = min(d4.xz, d4.yw); | 2249 vec2 d2 = min(d4.xz, d4.yw); |
2249 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); | 2250 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); |
2250 gl_FragColor = color * aa; | 2251 gl_FragColor = color * aa; |
2251 } | 2252 } |
2252 }); | 2253 }); |
2253 } | 2254 } |
2254 | 2255 |
2255 } // namespace cc | 2256 } // namespace cc |
OLD | NEW |