OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
10 | 10 |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 fsName); | 552 fsName); |
553 builder->fsCodeAppendf ("\t\t} else {\n"); | 553 builder->fsCodeAppendf ("\t\t} else {\n"); |
554 builder->fsCodeAppendf("\t\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvd
x.y,\n" | 554 builder->fsCodeAppendf("\t\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvd
x.y,\n" |
555 "\t\t\t 2.0*%s.x*duvdy.x - duvd
y.y);\n", | 555 "\t\t\t 2.0*%s.x*duvdy.x - duvd
y.y);\n", |
556 fsName, fsName); | 556 fsName, fsName); |
557 builder->fsCodeAppendf("\t\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fs
Name, fsName, | 557 builder->fsCodeAppendf("\t\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fs
Name, fsName, |
558 fsName); | 558 fsName); |
559 builder->fsCodeAppendf("\t\t\tedgeAlpha = " | 559 builder->fsCodeAppendf("\t\t\tedgeAlpha = " |
560 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0
);\n\t\t}\n"); | 560 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0
);\n\t\t}\n"); |
561 | 561 |
562 SkString modulate; | 562 |
563 GrGLSLModulatef<4>(&modulate, inputColor, "edgeAlpha"); | 563 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, |
564 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); | 564 (GrGLSLExpr<4>(inputColor) * GrGLSLExpr<1>("e
dgeAlpha")).c_str()); |
565 | 565 |
566 builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); | 566 builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); |
567 } | 567 } |
568 | 568 |
569 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { | 569 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { |
570 return 0x0; | 570 return 0x0; |
571 } | 571 } |
572 | 572 |
573 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_
OVERRIDE {} | 573 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_
OVERRIDE {} |
574 | 574 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 vOffset, // start vertex | 705 vOffset, // start vertex |
706 0, // start index | 706 0, // start index |
707 draw.fVertexCnt, | 707 draw.fVertexCnt, |
708 draw.fIndexCnt, | 708 draw.fIndexCnt, |
709 &devBounds); | 709 &devBounds); |
710 vOffset += draw.fVertexCnt; | 710 vOffset += draw.fVertexCnt; |
711 } | 711 } |
712 | 712 |
713 return true; | 713 return true; |
714 } | 714 } |
OLD | NEW |