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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 builder->fsCodeAppendf ("\t\t} else {\n"); | 501 builder->fsCodeAppendf ("\t\t} else {\n"); |
502 builder->fsCodeAppendf("\t\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvd
x.y,\n" | 502 builder->fsCodeAppendf("\t\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvd
x.y,\n" |
503 "\t\t\t 2.0*%s.x*duvdy.x - duvd
y.y);\n", | 503 "\t\t\t 2.0*%s.x*duvdy.x - duvd
y.y);\n", |
504 fsName, fsName); | 504 fsName, fsName); |
505 builder->fsCodeAppendf("\t\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fs
Name, fsName, | 505 builder->fsCodeAppendf("\t\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fs
Name, fsName, |
506 fsName); | 506 fsName); |
507 builder->fsCodeAppendf("\t\t\tedgeAlpha = " | 507 builder->fsCodeAppendf("\t\t\tedgeAlpha = " |
508 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0
);\n\t\t}\n"); | 508 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0
);\n\t\t}\n"); |
509 | 509 |
510 SkString modulate; | 510 SkString modulate; |
511 GrGLSLModulate4f(&modulate, inputColor, "edgeAlpha"); | 511 GrGLSLModulatef<4>(&modulate, inputColor, "edgeAlpha"); |
512 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); | 512 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()
); |
513 | 513 |
514 builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); | 514 builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); |
515 } | 515 } |
516 | 516 |
517 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { | 517 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG
LCaps&) { |
518 return 0x0; | 518 return 0x0; |
519 } | 519 } |
520 | 520 |
521 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_
OVERRIDE {} | 521 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_
OVERRIDE {} |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 create_vertices(segments, fanPt, verts, idxs); | 630 create_vertices(segments, fanPt, verts, idxs); |
631 | 631 |
632 target->drawIndexed(kTriangles_GrPrimitiveType, | 632 target->drawIndexed(kTriangles_GrPrimitiveType, |
633 0, // start vertex | 633 0, // start vertex |
634 0, // start index | 634 0, // start index |
635 vCount, | 635 vCount, |
636 iCount); | 636 iCount); |
637 | 637 |
638 return true; | 638 return true; |
639 } | 639 } |
OLD | NEW |