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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 } | 601 } |
602 | 602 |
603 /////////////////////////////////////////////////////////////////////////////// | 603 /////////////////////////////////////////////////////////////////////////////// |
604 | 604 |
605 GrCustomXPFactory::GrCustomXPFactory(SkXfermode::Mode mode) | 605 GrCustomXPFactory::GrCustomXPFactory(SkXfermode::Mode mode) |
606 : fMode(mode) { | 606 : fMode(mode) { |
607 this->initClassID<GrCustomXPFactory>(); | 607 this->initClassID<GrCustomXPFactory>(); |
608 } | 608 } |
609 | 609 |
610 GrXferProcessor* | 610 GrXferProcessor* |
611 GrCustomXPFactory::onCreateXferProcessor(const GrDrawTargetCaps& caps, | 611 GrCustomXPFactory::onCreateXferProcessor(const GrProcOptInfo& colorPOI, |
612 const GrProcOptInfo& colorPOI, | |
613 const GrProcOptInfo& coveragePOI, | 612 const GrProcOptInfo& coveragePOI, |
614 const GrDeviceCoordTexture* dstCopy) co
nst { | 613 const GrDeviceCoordTexture* dstCopy) co
nst { |
615 return CustomXP::Create(fMode, dstCopy, this->willReadDstColor(caps, colorPO
I, coveragePOI)); | 614 return CustomXP::Create(fMode, dstCopy, this->willReadDstColor(colorPOI, cov
eragePOI)); |
616 } | 615 } |
617 | 616 |
618 | 617 |
619 void GrCustomXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, | 618 void GrCustomXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, |
620 const GrProcOptInfo& coveragePOI, | 619 const GrProcOptInfo& coveragePOI, |
621 GrXPFactory::InvariantOutput* out
put) const { | 620 GrXPFactory::InvariantOutput* out
put) const { |
622 output->fWillBlendWithDst = true; | 621 output->fWillBlendWithDst = true; |
623 output->fBlendedColorFlags = 0; | 622 output->fBlendedColorFlags = 0; |
624 } | 623 } |
625 | 624 |
626 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); | 625 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); |
627 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, | 626 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, |
628 GrContext*, | 627 GrContext*, |
629 const GrDrawTargetCaps&, | 628 const GrDrawTargetCaps&, |
630 GrTexture*[]) { | 629 GrTexture*[]) { |
631 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas
tSeparableMode); | 630 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas
tSeparableMode); |
632 | 631 |
633 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); | 632 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); |
634 } | 633 } |
635 | 634 |
OLD | NEW |