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

Side by Side Diff: src/gpu/effects/GrBezierEffect.cpp

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 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
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/effects/GrBicubicEffect.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrBezierEffect.h" 8 #include "GrBezierEffect.h"
9 9
10 #include "glsl/GrGLSLFragmentShaderBuilder.h" 10 #include "glsl/GrGLSLFragmentShaderBuilder.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; 80 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
81 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 81 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
82 82
83 // emit attributes 83 // emit attributes
84 varyingHandler->emitAttributes(gp); 84 varyingHandler->emitAttributes(gp);
85 85
86 GrGLSLVertToFrag v(kVec4f_GrSLType); 86 GrGLSLVertToFrag v(kVec4f_GrSLType);
87 varyingHandler->addVarying("ConicCoeffs", &v, kHigh_GrSLPrecision); 87 varyingHandler->addVarying("ConicCoeffs", &v, kHigh_GrSLPrecision);
88 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs()->fName); 88 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs()->fName);
89 89
90 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 90 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
91 // Setup pass through color 91 // Setup pass through color
92 if (!gp.colorIgnored()) { 92 if (!gp.colorIgnored()) {
93 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); 93 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform);
94 } 94 }
95 95
96 // Setup position 96 // Setup position
97 this->setupPosition(vertBuilder, 97 this->setupPosition(vertBuilder,
98 uniformHandler, 98 uniformHandler,
99 gpArgs, 99 gpArgs,
100 gp.inPosition()->fName, 100 gp.inPosition()->fName,
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; 354 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
355 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 355 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
356 356
357 // emit attributes 357 // emit attributes
358 varyingHandler->emitAttributes(gp); 358 varyingHandler->emitAttributes(gp);
359 359
360 GrGLSLVertToFrag v(kVec4f_GrSLType); 360 GrGLSLVertToFrag v(kVec4f_GrSLType);
361 varyingHandler->addVarying("HairQuadEdge", &v); 361 varyingHandler->addVarying("HairQuadEdge", &v);
362 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inHairQuadEdge()->fName); 362 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inHairQuadEdge()->fName);
363 363
364 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 364 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
365 // Setup pass through color 365 // Setup pass through color
366 if (!gp.colorIgnored()) { 366 if (!gp.colorIgnored()) {
367 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); 367 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform);
368 } 368 }
369 369
370 // Setup position 370 // Setup position
371 this->setupPosition(vertBuilder, 371 this->setupPosition(vertBuilder,
372 uniformHandler, 372 uniformHandler,
373 gpArgs, 373 gpArgs,
374 gp.inPosition()->fName, 374 gp.inPosition()->fName,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; 557 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
558 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 558 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
559 559
560 // emit attributes 560 // emit attributes
561 varyingHandler->emitAttributes(gp); 561 varyingHandler->emitAttributes(gp);
562 562
563 GrGLSLVertToFrag v(kVec4f_GrSLType); 563 GrGLSLVertToFrag v(kVec4f_GrSLType);
564 varyingHandler->addVarying("CubicCoeffs", &v, kHigh_GrSLPrecision); 564 varyingHandler->addVarying("CubicCoeffs", &v, kHigh_GrSLPrecision);
565 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inCubicCoeffs()->fName); 565 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inCubicCoeffs()->fName);
566 566
567 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 567 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
568 // Setup pass through color 568 // Setup pass through color
569 if (!gp.colorIgnored()) { 569 if (!gp.colorIgnored()) {
570 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); 570 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform);
571 } 571 }
572 572
573 // Setup position 573 // Setup position
574 this->setupPosition(vertBuilder, 574 this->setupPosition(vertBuilder,
575 uniformHandler, 575 uniformHandler,
576 gpArgs, 576 gpArgs,
577 gp.inPosition()->fName, 577 gp.inPosition()->fName,
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 do { 721 do {
722 GrPrimitiveEdgeType edgeType = 722 GrPrimitiveEdgeType edgeType =
723 static_cast<GrPrimitiveEdgeType>( 723 static_cast<GrPrimitiveEdgeType>(
724 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); 724 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
725 gp = GrCubicEffect::Create(GrRandomColor(d->fRandom), 725 gp = GrCubicEffect::Create(GrRandomColor(d->fRandom),
726 GrTest::TestMatrix(d->fRandom), edgeType, *d- >fCaps); 726 GrTest::TestMatrix(d->fRandom), edgeType, *d- >fCaps);
727 } while (nullptr == gp); 727 } while (nullptr == gp);
728 return gp; 728 return gp;
729 } 729 }
730 730
OLDNEW
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698