| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |