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

Side by Side Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.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 "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkRadialGradient_Table.h" 10 #include "SkRadialGradient_Table.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 GrAlwaysAssert(fp); 494 GrAlwaysAssert(fp);
495 return fp; 495 return fp;
496 } 496 }
497 497
498 ///////////////////////////////////////////////////////////////////// 498 /////////////////////////////////////////////////////////////////////
499 499
500 void GrGLRadialGradient::emitCode(EmitArgs& args) { 500 void GrGLRadialGradient::emitCode(EmitArgs& args) {
501 const GrRadialGradient& ge = args.fFp.cast<GrRadialGradient>(); 501 const GrRadialGradient& ge = args.fFp.cast<GrRadialGradient>();
502 this->emitUniforms(args.fBuilder, ge); 502 this->emitUniforms(args.fBuilder, ge);
503 SkString t("length("); 503 SkString t("length(");
504 t.append(args.fBuilder->getFragmentShaderBuilder()->ensureFSCoords2D(args.fC oords, 0)); 504 t.append(args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0));
505 t.append(")"); 505 t.append(")");
506 this->emitColor(args.fBuilder, ge, t.c_str(), args.fOutputColor, args.fInput Color, 506 this->emitColor(args.fBuilder,
507 args.fFragBuilder,
508 ge, t.c_str(),
509 args.fOutputColor,
510 args.fInputColor,
507 args.fSamplers); 511 args.fSamplers);
508 } 512 }
509 513
510 ///////////////////////////////////////////////////////////////////// 514 /////////////////////////////////////////////////////////////////////
511 515
512 const GrFragmentProcessor* SkRadialGradient::asFragmentProcessor( 516 const GrFragmentProcessor* SkRadialGradient::asFragmentProcessor(
513 GrContext* context, 517 GrContext* context,
514 const SkMatrix& viewM, 518 const SkMatrix& viewM,
515 const SkMatrix* localMatrix, 519 const SkMatrix* localMatrix,
516 SkFilterQuality) const { 520 SkFilterQuality) const {
(...skipping 28 matching lines...) Expand all
545 str->appendScalar(fCenter.fY); 549 str->appendScalar(fCenter.fY);
546 str->append(") radius: "); 550 str->append(") radius: ");
547 str->appendScalar(fRadius); 551 str->appendScalar(fRadius);
548 str->append(" "); 552 str->append(" ");
549 553
550 this->INHERITED::toString(str); 554 this->INHERITED::toString(str);
551 555
552 str->append(")"); 556 str->append(")");
553 } 557 }
554 #endif 558 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698