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

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: GetTextureMatrix should be the only available method Created 4 years, 8 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 uniform mat4 matrix; 744 uniform mat4 matrix;
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 = (texMatrix * vec4(a_texCoord.xy, 0.0, 1.0)).xy;
755 vec2(texMatrix * vec4(a_texCoord.x, 1.0 - a_texCoord.y, 0.0, 1.0));
756 } 755 }
757 }); 756 });
758 } 757 }
759 758
760 #define BLEND_MODE_UNIFORMS "s_backdropTexture", \ 759 #define BLEND_MODE_UNIFORMS "s_backdropTexture", \
761 "s_originalBackdropTexture", \ 760 "s_originalBackdropTexture", \
762 "backdropRect" 761 "backdropRect"
763 #define UNUSED_BLEND_MODE_UNIFORMS (!has_blend_mode() ? 3 : 0) 762 #define UNUSED_BLEND_MODE_UNIFORMS (!has_blend_mode() ? 3 : 0)
764 #define BLEND_MODE_SET_LOCATIONS(X, POS) \ 763 #define BLEND_MODE_SET_LOCATIONS(X, POS) \
765 if (has_blend_mode()) { \ 764 if (has_blend_mode()) { \
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 void main() { 2245 void main() {
2247 vec4 d4 = min(edge_dist[0], edge_dist[1]); 2246 vec4 d4 = min(edge_dist[0], edge_dist[1]);
2248 vec2 d2 = min(d4.xz, d4.yw); 2247 vec2 d2 = min(d4.xz, d4.yw);
2249 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); 2248 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0);
2250 gl_FragColor = color * aa; 2249 gl_FragColor = color * aa;
2251 } 2250 }
2252 }); 2251 });
2253 } 2252 }
2254 2253
2255 } // namespace cc 2254 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698