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