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 inline int repeat_bits(int x, const int bits) { | 10 static inline int repeat_bits(int x, const int bits) { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 ///////////////////////////////////////////////////////////////////// | 526 ///////////////////////////////////////////////////////////////////// |
527 | 527 |
528 void GrGLLinearGradient::emitCode(EmitArgs& args) { | 528 void GrGLLinearGradient::emitCode(EmitArgs& args) { |
529 const GrLinearGradient& ge = args.fFp.cast<GrLinearGradient>(); | 529 const GrLinearGradient& ge = args.fFp.cast<GrLinearGradient>(); |
530 this->emitUniforms(args.fBuilder, ge); | 530 this->emitUniforms(args.fBuilder, ge); |
531 SkString t = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0); | 531 SkString t = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0); |
532 t.append(".x"); | 532 t.append(".x"); |
533 this->emitColor(args.fBuilder, | 533 this->emitColor(args.fBuilder, |
534 args.fFragBuilder, | 534 args.fFragBuilder, |
| 535 args.fGLSLCaps, |
535 ge, t.c_str(), | 536 ge, t.c_str(), |
536 args.fOutputColor, | 537 args.fOutputColor, |
537 args.fInputColor, | 538 args.fInputColor, |
538 args.fSamplers); | 539 args.fSamplers); |
539 } | 540 } |
540 | 541 |
541 ///////////////////////////////////////////////////////////////////// | 542 ///////////////////////////////////////////////////////////////////// |
542 | 543 |
543 const GrFragmentProcessor* SkLinearGradient::asFragmentProcessor( | 544 const GrFragmentProcessor* SkLinearGradient::asFragmentProcessor( |
544 GrContext* context, | 545 GrContext* context, |
(...skipping 28 matching lines...) Expand all Loading... |
573 str->append("SkLinearGradient ("); | 574 str->append("SkLinearGradient ("); |
574 | 575 |
575 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 576 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
576 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 577 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
577 | 578 |
578 this->INHERITED::toString(str); | 579 this->INHERITED::toString(str); |
579 | 580 |
580 str->append(")"); | 581 str->append(")"); |
581 } | 582 } |
582 #endif | 583 #endif |
OLD | NEW |