Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: cc/output/shader.cc

Issue 1818073002: Always apply UniformMatrix4fvStreamTextureMatrixCHROMIUM matrix argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase [If you wait by the river long enough, the bodies of your gyp files will float by] Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 = 755 v_texCoord = (texMatrix * vec4(a_texCoord.xy, 0.0, 1.0)).xy;
756 vec2(texMatrix * vec4(a_texCoord.x, 1.0 - a_texCoord.y, 0.0, 1.0));
757 } 756 }
758 }); 757 });
759 } 758 }
760 759
761 #define BLEND_MODE_UNIFORMS "s_backdropTexture", \ 760 #define BLEND_MODE_UNIFORMS "s_backdropTexture", \
762 "s_originalBackdropTexture", \ 761 "s_originalBackdropTexture", \
763 "backdropRect" 762 "backdropRect"
764 #define UNUSED_BLEND_MODE_UNIFORMS (!has_blend_mode() ? 3 : 0) 763 #define UNUSED_BLEND_MODE_UNIFORMS (!has_blend_mode() ? 3 : 0)
765 #define BLEND_MODE_SET_LOCATIONS(X, POS) \ 764 #define BLEND_MODE_SET_LOCATIONS(X, POS) \
766 if (has_blend_mode()) { \ 765 if (has_blend_mode()) { \
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 void main() { 2203 void main() {
2205 vec4 d4 = min(edge_dist[0], edge_dist[1]); 2204 vec4 d4 = min(edge_dist[0], edge_dist[1]);
2206 vec2 d2 = min(d4.xz, d4.yw); 2205 vec2 d2 = min(d4.xz, d4.yw);
2207 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); 2206 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0);
2208 gl_FragColor = color * aa; 2207 gl_FragColor = color * aa;
2209 } 2208 }
2210 }); 2209 });
2211 } 2210 }
2212 2211
2213 } // namespace cc 2212 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_stream_texture_matrix.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698