| 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 // No hardware support for advanced blend equations; we will need to do
it in the shader. | 800 // No hardware support for advanced blend equations; we will need to do
it in the shader. |
| 801 return true; | 801 return true; |
| 802 } | 802 } |
| 803 if (coveragePOI.isFourChannelOutput()) { | 803 if (coveragePOI.isFourChannelOutput()) { |
| 804 // Advanced blend equations can't tweak alpha for RGB coverage. | 804 // Advanced blend equations can't tweak alpha for RGB coverage. |
| 805 return true; | 805 return true; |
| 806 } | 806 } |
| 807 return false; | 807 return false; |
| 808 } | 808 } |
| 809 | 809 |
| 810 void GrCustomXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, | 810 void GrCustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
| 811 const GrProcOptInfo& coveragePOI, | 811 InvariantBlendedColor* blendedC
olor) const { |
| 812 GrXPFactory::InvariantOutput* out
put) const { | 812 blendedColor->fWillBlendWithDst = true; |
| 813 output->fWillBlendWithDst = true; | 813 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
| 814 output->fBlendedColorFlags = 0; | |
| 815 } | 814 } |
| 816 | 815 |
| 817 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); | 816 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); |
| 818 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, | 817 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, |
| 819 GrContext*, | 818 GrContext*, |
| 820 const GrCaps&, | 819 const GrCaps&, |
| 821 GrTexture*[]) { | 820 GrTexture*[]) { |
| 822 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas
tSeparableMode); | 821 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas
tSeparableMode); |
| 823 | 822 |
| 824 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); | 823 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); |
| 825 } | 824 } |
| 826 | 825 |
| OLD | NEW |