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

Side by Side Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 25048002: Express (GLSL expression, possibly known value) pairs as a class (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 fsName); 553 fsName);
554 builder->fsCodeAppendf ("\t\t} else {\n"); 554 builder->fsCodeAppendf ("\t\t} else {\n");
555 builder->fsCodeAppendf("\t\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvd x.y,\n" 555 builder->fsCodeAppendf("\t\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvd x.y,\n"
556 "\t\t\t 2.0*%s.x*duvdy.x - duvd y.y);\n", 556 "\t\t\t 2.0*%s.x*duvdy.x - duvd y.y);\n",
557 fsName, fsName); 557 fsName, fsName);
558 builder->fsCodeAppendf("\t\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fs Name, fsName, 558 builder->fsCodeAppendf("\t\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fs Name, fsName,
559 fsName); 559 fsName);
560 builder->fsCodeAppendf("\t\t\tedgeAlpha = " 560 builder->fsCodeAppendf("\t\t\tedgeAlpha = "
561 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0 );\n\t\t}\n"); 561 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0 );\n\t\t}\n");
562 562
563 SkString modulate; 563
564 GrGLSLModulatef<4>(&modulate, inputColor, "edgeAlpha"); 564 builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
565 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str() ); 565 (GrGLSLExpr<4>(inputColor) * GrGLSLExpr<1>("e dgeAlpha")).c_str());
566 566
567 vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str ()); 567 vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str ());
568 } 568 }
569 569
570 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG LCaps&) { 570 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG LCaps&) {
571 return 0x0; 571 return 0x0;
572 } 572 }
573 573
574 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_ OVERRIDE {} 574 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_ OVERRIDE {}
575 575
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 vOffset, // start vertex 706 vOffset, // start vertex
707 0, // start index 707 0, // start index
708 draw.fVertexCnt, 708 draw.fVertexCnt,
709 draw.fIndexCnt, 709 draw.fIndexCnt,
710 &devBounds); 710 &devBounds);
711 vOffset += draw.fVertexCnt; 711 vOffset += draw.fVertexCnt;
712 } 712 }
713 713
714 return true; 714 return true;
715 } 715 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698