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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 this->initClassID<GrCustomXferFP>(); | 480 this->initClassID<GrCustomXferFP>(); |
481 | 481 |
482 SkASSERT(background); | 482 SkASSERT(background); |
483 fBackgroundTransform.reset(kLocal_GrCoordSet, background, | 483 fBackgroundTransform.reset(kLocal_GrCoordSet, background, |
484 GrTextureParams::kNone_FilterMode); | 484 GrTextureParams::kNone_FilterMode); |
485 this->addCoordTransform(&fBackgroundTransform); | 485 this->addCoordTransform(&fBackgroundTransform); |
486 fBackgroundAccess.reset(background); | 486 fBackgroundAccess.reset(background); |
487 this->addTextureAccess(&fBackgroundAccess); | 487 this->addTextureAccess(&fBackgroundAccess); |
488 } | 488 } |
489 | 489 |
490 void GrCustomXferFP::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBui
lder* b) const { | 490 void GrCustomXferFP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
uilder* b) const { |
491 GLCustomXferFP::GenKey(*this, caps, b); | 491 GLCustomXferFP::GenKey(*this, caps, b); |
492 } | 492 } |
493 | 493 |
494 GrGLFragmentProcessor* GrCustomXferFP::createGLInstance() const { | 494 GrGLFragmentProcessor* GrCustomXferFP::createGLInstance() const { |
495 return SkNEW_ARGS(GLCustomXferFP, (*this)); | 495 return SkNEW_ARGS(GLCustomXferFP, (*this)); |
496 } | 496 } |
497 | 497 |
498 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const { | 498 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const { |
499 const GrCustomXferFP& s = other.cast<GrCustomXferFP>(); | 499 const GrCustomXferFP& s = other.cast<GrCustomXferFP>(); |
500 return fMode == s.fMode; | 500 return fMode == s.fMode; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 } | 809 } |
810 | 810 |
811 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); | 811 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); |
812 GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) { | 812 GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) { |
813 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, | 813 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, |
814 SkXfermode::kLastSeparableMode); | 814 SkXfermode::kLastSeparableMode); |
815 | 815 |
816 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); | 816 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); |
817 } | 817 } |
818 | 818 |
OLD | NEW |