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