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

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

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 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
« no previous file with comments | « src/gpu/GrPathProcessor.cpp ('k') | src/gpu/effects/GrBezierEffect.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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 const SkMatrix& localMatrix() const { return fLocalMatrix; } 541 const SkMatrix& localMatrix() const { return fLocalMatrix; }
542 bool usesLocalCoords() const { return fUsesLocalCoords; } 542 bool usesLocalCoords() const { return fUsesLocalCoords; }
543 543
544 class GLProcessor : public GrGLGeometryProcessor { 544 class GLProcessor : public GrGLGeometryProcessor {
545 public: 545 public:
546 GLProcessor() 546 GLProcessor()
547 : fColor(GrColor_ILLEGAL) {} 547 : fColor(GrColor_ILLEGAL) {}
548 548
549 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { 549 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
550 const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>(); 550 const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>();
551 GrGLGPBuilder* pb = args.fPB; 551 GrGLSLGPBuilder* pb = args.fPB;
552 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); 552 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
553 553
554 // emit attributes 554 // emit attributes
555 vsBuilder->emitAttributes(qe); 555 vsBuilder->emitAttributes(qe);
556 556
557 GrGLVertToFrag v(kVec4f_GrSLType); 557 GrGLSLVertToFrag v(kVec4f_GrSLType);
558 args.fPB->addVarying("QuadEdge", &v); 558 args.fPB->addVarying("QuadEdge", &v);
559 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName ); 559 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName );
560 560
561 // Setup pass through color 561 // Setup pass through color
562 if (!qe.colorIgnored()) { 562 if (!qe.colorIgnored()) {
563 this->setupUniformColor(pb, args.fOutputColor, &fColorUniform); 563 this->setupUniformColor(pb, args.fOutputColor, &fColorUniform);
564 } 564 }
565 565
566 // Setup position 566 // Setup position
567 this->setupPosition(pb, gpArgs, qe.inPosition()->fName); 567 this->setupPosition(pb, gpArgs, qe.inPosition()->fName);
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { 1007 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) {
1008 AAConvexPathBatch::Geometry geometry; 1008 AAConvexPathBatch::Geometry geometry;
1009 geometry.fColor = GrRandomColor(random); 1009 geometry.fColor = GrRandomColor(random);
1010 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); 1010 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
1011 geometry.fPath = GrTest::TestPathConvex(random); 1011 geometry.fPath = GrTest::TestPathConvex(random);
1012 1012
1013 return AAConvexPathBatch::Create(geometry); 1013 return AAConvexPathBatch::Create(geometry);
1014 } 1014 }
1015 1015
1016 #endif 1016 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPathProcessor.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698