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

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

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/output/overlay_unittest.cc ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 matrix_location_ = locations[0]; 539 matrix_location_ = locations[0];
540 quad_location_ = locations[1]; 540 quad_location_ = locations[1];
541 vertex_tex_transform_location_ = locations[2]; 541 vertex_tex_transform_location_ = locations[2];
542 } 542 }
543 543
544 std::string VertexShaderTile::GetShaderString() const { 544 std::string VertexShaderTile::GetShaderString() const {
545 // clang-format off 545 // clang-format off
546 return VERTEX_SHADER( 546 return VERTEX_SHADER(
547 // clang-format on 547 // clang-format on
548 attribute TexCoordPrecision vec4 a_position; 548 attribute TexCoordPrecision vec4 a_position;
549 attribute TexCoordPrecision vec2 a_texCoord;
549 attribute float a_index; 550 attribute float a_index;
550 uniform mat4 matrix; 551 uniform mat4 matrix;
551 uniform TexCoordPrecision vec2 quad[4]; 552 uniform TexCoordPrecision vec2 quad[4];
552 uniform TexCoordPrecision vec4 vertexTexTransform; 553 uniform TexCoordPrecision vec4 vertexTexTransform;
553 varying TexCoordPrecision vec2 v_texCoord; 554 varying TexCoordPrecision vec2 v_texCoord;
554 void main() { 555 void main() {
555 vec2 pos = quad[int(a_index)]; // NOLINT 556 vec2 pos = quad[int(a_index)]; // NOLINT
556 gl_Position = matrix * vec4(pos, a_position.z, a_position.w); 557 gl_Position = matrix * vec4(pos, a_position.z, a_position.w);
557 v_texCoord = pos.xy * vertexTexTransform.zw + vertexTexTransform.xy; 558 v_texCoord = a_texCoord * vertexTexTransform.zw + vertexTexTransform.xy;
558 } 559 }
559 // clang-format off 560 // clang-format off
560 ); // NOLINT(whitespace/parens) 561 ); // NOLINT(whitespace/parens)
561 // clang-format on 562 // clang-format on
562 } 563 }
563 564
564 VertexShaderTileAA::VertexShaderTileAA() 565 VertexShaderTileAA::VertexShaderTileAA()
565 : matrix_location_(-1), 566 : matrix_location_(-1),
566 viewport_location_(-1), 567 viewport_location_(-1),
567 quad_location_(-1), 568 quad_location_(-1),
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); 1980 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0);
1980 float picker = abs(coord.x - coord.y); // NOLINT 1981 float picker = abs(coord.x - coord.y); // NOLINT
1981 gl_FragColor = mix(color1, color2, picker) * alpha; 1982 gl_FragColor = mix(color1, color2, picker) * alpha;
1982 } 1983 }
1983 // clang-format off 1984 // clang-format off
1984 ); // NOLINT(whitespace/parens) 1985 ); // NOLINT(whitespace/parens)
1985 // clang-format on 1986 // clang-format on
1986 } 1987 }
1987 1988
1988 } // namespace cc 1989 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_unittest.cc ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698