OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "effects/GrCustomXfermode.h" | 8 #include "effects/GrCustomXfermode.h" |
9 #include "effects/GrCustomXfermodePriv.h" | 9 #include "effects/GrCustomXfermodePriv.h" |
10 | 10 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const { | 499 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const { |
500 const GrCustomXferFP& s = other.cast<GrCustomXferFP>(); | 500 const GrCustomXferFP& s = other.cast<GrCustomXferFP>(); |
501 return fMode == s.fMode; | 501 return fMode == s.fMode; |
502 } | 502 } |
503 | 503 |
504 void GrCustomXferFP::onComputeInvariantOutput(GrInvariantOutput* inout) const { | 504 void GrCustomXferFP::onComputeInvariantOutput(GrInvariantOutput* inout) const { |
505 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); | 505 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
506 } | 506 } |
507 | 507 |
508 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCustomXferFP); | 508 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCustomXferFP); |
509 const GrFragmentProcessor* GrCustomXferFP::TestCreate(GrProcessorTestData* d) { | 509 GrFragmentProcessor* GrCustomXferFP::TestCreate(GrProcessorTestData* d) { |
510 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode
::kLastSeparableMode); | 510 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode
::kLastSeparableMode); |
511 | 511 |
512 return new GrCustomXferFP(d->fProcDataManager, static_cast<SkXfermode::Mode>
(mode), | 512 return new GrCustomXferFP(d->fProcDataManager, static_cast<SkXfermode::Mode>
(mode), |
513 d->fTextures[0]); | 513 d->fTextures[0]); |
514 } | 514 } |
515 | 515 |
516 /////////////////////////////////////////////////////////////////////////////// | 516 /////////////////////////////////////////////////////////////////////////////// |
517 // Xfer Processor | 517 // Xfer Processor |
518 /////////////////////////////////////////////////////////////////////////////// | 518 /////////////////////////////////////////////////////////////////////////////// |
519 | 519 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 return !can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps); | 798 return !can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps); |
799 } | 799 } |
800 | 800 |
801 void GrCustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 801 void GrCustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
802 InvariantBlendedColor* blendedC
olor) const { | 802 InvariantBlendedColor* blendedC
olor) const { |
803 blendedColor->fWillBlendWithDst = true; | 803 blendedColor->fWillBlendWithDst = true; |
804 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; | 804 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
805 } | 805 } |
806 | 806 |
807 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); | 807 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); |
808 const GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) { | 808 GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) { |
809 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, | 809 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, |
810 SkXfermode::kLastSeparableMode); | 810 SkXfermode::kLastSeparableMode); |
811 | 811 |
812 return new GrCustomXPFactory(static_cast<SkXfermode::Mode>(mode)); | 812 return new GrCustomXPFactory(static_cast<SkXfermode::Mode>(mode)); |
813 } | 813 } |
814 | 814 |
OLD | NEW |