OLD | NEW |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 dstX += SK_Scalar1; | 408 dstX += SK_Scalar1; |
409 } while (--count != 0); | 409 } while (--count != 0); |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 ///////////////////////////////////////////////////////////////////// | 413 ///////////////////////////////////////////////////////////////////// |
414 | 414 |
415 #if SK_SUPPORT_GPU | 415 #if SK_SUPPORT_GPU |
416 | 416 |
417 #include "SkGr.h" | 417 #include "SkGr.h" |
418 #include "effects/GrExtractAlphaFragmentProcessor.h" | |
419 #include "gl/builders/GrGLProgramBuilder.h" | 418 #include "gl/builders/GrGLProgramBuilder.h" |
420 | 419 |
421 class GrGLRadialGradient : public GrGLGradientEffect { | 420 class GrGLRadialGradient : public GrGLGradientEffect { |
422 public: | 421 public: |
423 | 422 |
424 GrGLRadialGradient(const GrProcessor&) {} | 423 GrGLRadialGradient(const GrProcessor&) {} |
425 virtual ~GrGLRadialGradient() { } | 424 virtual ~GrGLRadialGradient() { } |
426 | 425 |
427 virtual void emitCode(EmitArgs&) override; | 426 virtual void emitCode(EmitArgs&) override; |
428 | 427 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 if (localMatrix) { | 526 if (localMatrix) { |
528 SkMatrix inv; | 527 SkMatrix inv; |
529 if (!localMatrix->invert(&inv)) { | 528 if (!localMatrix->invert(&inv)) { |
530 return nullptr; | 529 return nullptr; |
531 } | 530 } |
532 matrix.postConcat(inv); | 531 matrix.postConcat(inv); |
533 } | 532 } |
534 matrix.postConcat(fPtsToUnit); | 533 matrix.postConcat(fPtsToUnit); |
535 SkAutoTUnref<const GrFragmentProcessor> inner( | 534 SkAutoTUnref<const GrFragmentProcessor> inner( |
536 GrRadialGradient::Create(context, procDataManager, *this, matrix, fT
ileMode)); | 535 GrRadialGradient::Create(context, procDataManager, *this, matrix, fT
ileMode)); |
537 return GrExtractAlphaFragmentProcessor::Create(inner); | 536 return GrFragmentProcessor::MulOuputByInputAlpha(inner); |
538 } | 537 } |
539 | 538 |
540 #endif | 539 #endif |
541 | 540 |
542 #ifndef SK_IGNORE_TO_STRING | 541 #ifndef SK_IGNORE_TO_STRING |
543 void SkRadialGradient::toString(SkString* str) const { | 542 void SkRadialGradient::toString(SkString* str) const { |
544 str->append("SkRadialGradient: ("); | 543 str->append("SkRadialGradient: ("); |
545 | 544 |
546 str->append("center: ("); | 545 str->append("center: ("); |
547 str->appendScalar(fCenter.fX); | 546 str->appendScalar(fCenter.fX); |
548 str->append(", "); | 547 str->append(", "); |
549 str->appendScalar(fCenter.fY); | 548 str->appendScalar(fCenter.fY); |
550 str->append(") radius: "); | 549 str->append(") radius: "); |
551 str->appendScalar(fRadius); | 550 str->appendScalar(fRadius); |
552 str->append(" "); | 551 str->append(" "); |
553 | 552 |
554 this->INHERITED::toString(str); | 553 this->INHERITED::toString(str); |
555 | 554 |
556 str->append(")"); | 555 str->append(")"); |
557 } | 556 } |
558 #endif | 557 #endif |
OLD | NEW |