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

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

Issue 25023003: Implement color filter as GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review comments 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
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 562
563 builder->fsCodeAppendf("\t%s = %s;\n", outputColor, 563 builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
564 (GrGLSLExpr<4>(inputColor) * GrGLSLExpr<1>("e dgeAlpha")).c_str()); 564 (GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeA lpha")).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
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 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698