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

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

Issue 678953002: Default geometry processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dm bug 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
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 fsBuilder->codeAppendf("edgeAlpha = " 554 fsBuilder->codeAppendf("edgeAlpha = "
555 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0 );}"); 555 "clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0 );}");
556 556
557 557
558 fsBuilder->codeAppendf("%s = %s;", args.fOutput, 558 fsBuilder->codeAppendf("%s = %s;", args.fOutput,
559 (GrGLSLExpr4(args.fInput) * GrGLSLExpr1("edge Alpha")).c_str()); 559 (GrGLSLExpr4(args.fInput) * GrGLSLExpr1("edge Alpha")).c_str());
560 560
561 const GrShaderVar& inQuadEdge = args.fGP.cast<QuadEdgeEffect>().inQu adEdge(); 561 const GrShaderVar& inQuadEdge = args.fGP.cast<QuadEdgeEffect>().inQu adEdge();
562 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); 562 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
563 vsBuilder->codeAppendf("\t%s = %s;\n", v.vsOut(), inQuadEdge.c_str() ); 563 vsBuilder->codeAppendf("\t%s = %s;\n", v.vsOut(), inQuadEdge.c_str() );
564
565 // setup position varying
566 vsBuilder->codeAppendf("vec3 pos3 = %s * vec3(%s, 1);", args.fGP.uVi ewM(),
567 args.fGP.inPosition());
568 vsBuilder->transformPositionToDeviceSpace("pos3");
564 } 569 }
565 570
566 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcess orKeyBuilder*) {} 571 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcess orKeyBuilder*) {}
567 572
568 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE {} 573 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE {}
569 574
570 private: 575 private:
571 typedef GrGLGeometryProcessor INHERITED; 576 typedef GrGLGeometryProcessor INHERITED;
572 }; 577 };
573 578
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 vOffset, // start vertex 711 vOffset, // start vertex
707 0, // start index 712 0, // start index
708 draw.fVertexCnt, 713 draw.fVertexCnt,
709 draw.fIndexCnt, 714 draw.fIndexCnt,
710 &devBounds); 715 &devBounds);
711 vOffset += draw.fVertexCnt; 716 vOffset += draw.fVertexCnt;
712 } 717 }
713 718
714 return true; 719 return true;
715 } 720 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698