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

Side by Side Diff: src/effects/gradients/SkLinearGradient.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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "SkLinearGradient.h" 8 #include "SkLinearGradient.h"
9 9
10 static const float kInv255Float = 1.0f / 255; 10 static const float kInv255Float = 1.0f / 255;
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 601
602 ///////////////////////////////////////////////////////////////////// 602 /////////////////////////////////////////////////////////////////////
603 603
604 void GrGLLinearGradient::emitCode(EmitArgs& args) { 604 void GrGLLinearGradient::emitCode(EmitArgs& args) {
605 const GrLinearGradient& ge = args.fFp.cast<GrLinearGradient>(); 605 const GrLinearGradient& ge = args.fFp.cast<GrLinearGradient>();
606 this->emitUniforms(args.fBuilder, ge); 606 this->emitUniforms(args.fBuilder, ge);
607 SkString t = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0); 607 SkString t = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0);
608 t.append(".x"); 608 t.append(".x");
609 this->emitColor(args.fBuilder, 609 this->emitColor(args.fBuilder,
610 args.fFragBuilder, 610 args.fFragBuilder,
611 args.fGLSLCaps,
611 ge, t.c_str(), 612 ge, t.c_str(),
612 args.fOutputColor, 613 args.fOutputColor,
613 args.fInputColor, 614 args.fInputColor,
614 args.fSamplers); 615 args.fSamplers);
615 } 616 }
616 617
617 ///////////////////////////////////////////////////////////////////// 618 /////////////////////////////////////////////////////////////////////
618 619
619 const GrFragmentProcessor* SkLinearGradient::asFragmentProcessor( 620 const GrFragmentProcessor* SkLinearGradient::asFragmentProcessor(
620 GrContext* context, 621 GrContext* context,
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 } 911 }
911 } else { 912 } else {
912 if (fApplyAlphaAfterInterp) { 913 if (fApplyAlphaAfterInterp) {
913 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe r); 914 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe r);
914 } else { 915 } else {
915 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith er); 916 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith er);
916 } 917 }
917 } 918 }
918 } 919 }
919 920
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShaderPriv.h ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698