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

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

Issue 1453623003: Move glsl onto EmitArgs struct for emitCode (Closed) Base URL: https://skia.googlesource.com/skia.git@moveShaders
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/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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.fFragBuilder->ensureFSCoords2D(args.fCoords, 0)); 504 t.append(args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0));
505 t.append(")"); 505 t.append(")");
506 this->emitColor(args.fBuilder, 506 this->emitColor(args.fBuilder,
507 args.fFragBuilder, 507 args.fFragBuilder,
508 args.fGLSLCaps,
508 ge, t.c_str(), 509 ge, t.c_str(),
509 args.fOutputColor, 510 args.fOutputColor,
510 args.fInputColor, 511 args.fInputColor,
511 args.fSamplers); 512 args.fSamplers);
512 } 513 }
513 514
514 ///////////////////////////////////////////////////////////////////// 515 /////////////////////////////////////////////////////////////////////
515 516
516 const GrFragmentProcessor* SkRadialGradient::asFragmentProcessor( 517 const GrFragmentProcessor* SkRadialGradient::asFragmentProcessor(
517 GrContext* context, 518 GrContext* context,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 str->appendScalar(fCenter.fY); 550 str->appendScalar(fCenter.fY);
550 str->append(") radius: "); 551 str->append(") radius: ");
551 str->appendScalar(fRadius); 552 str->appendScalar(fRadius);
552 str->append(" "); 553 str->append(" ");
553 554
554 this->INHERITED::toString(str); 555 this->INHERITED::toString(str);
555 556
556 str->append(")"); 557 str->append(")");
557 } 558 }
558 #endif 559 #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