| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 key |= proc.cast<GrCustomXferFP>().mode() << 1; | 471 key |= proc.cast<GrCustomXferFP>().mode() << 1; |
| 472 b->add32(key); | 472 b->add32(key); |
| 473 } | 473 } |
| 474 | 474 |
| 475 private: | 475 private: |
| 476 typedef GrGLFragmentProcessor INHERITED; | 476 typedef GrGLFragmentProcessor INHERITED; |
| 477 }; | 477 }; |
| 478 | 478 |
| 479 /////////////////////////////////////////////////////////////////////////////// | 479 /////////////////////////////////////////////////////////////////////////////// |
| 480 | 480 |
| 481 GrCustomXferFP::GrCustomXferFP(SkXfermode::Mode mode, GrTexture* background) | 481 GrCustomXferFP::GrCustomXferFP(GrShaderDataManager*, SkXfermode::Mode mode, GrTe
xture* background) |
| 482 : fMode(mode) { | 482 : fMode(mode) { |
| 483 this->initClassID<GrCustomXferFP>(); | 483 this->initClassID<GrCustomXferFP>(); |
| 484 | 484 |
| 485 SkASSERT(background); | 485 SkASSERT(background); |
| 486 fBackgroundTransform.reset(kLocal_GrCoordSet, background, | 486 fBackgroundTransform.reset(kLocal_GrCoordSet, background, |
| 487 GrTextureParams::kNone_FilterMode); | 487 GrTextureParams::kNone_FilterMode); |
| 488 this->addCoordTransform(&fBackgroundTransform); | 488 this->addCoordTransform(&fBackgroundTransform); |
| 489 fBackgroundAccess.reset(background); | 489 fBackgroundAccess.reset(background); |
| 490 this->addTextureAccess(&fBackgroundAccess); | 490 this->addTextureAccess(&fBackgroundAccess); |
| 491 } | 491 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); | 816 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); |
| 817 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, | 817 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, |
| 818 GrContext*, | 818 GrContext*, |
| 819 const GrCaps&, | 819 const GrCaps&, |
| 820 GrTexture*[]) { | 820 GrTexture*[]) { |
| 821 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas
tSeparableMode); | 821 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas
tSeparableMode); |
| 822 | 822 |
| 823 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); | 823 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); |
| 824 } | 824 } |
| 825 | 825 |
| OLD | NEW |