| 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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 | 745 |
| 746 | 746 |
| 747 f * blend(Sa, Da) + (1-f) * Da | 747 f * blend(Sa, Da) + (1-f) * Da |
| 748 = f * (Sa + Da - Sa * Da) + (1-f) * Da | 748 = f * (Sa + Da - Sa * Da) + (1-f) * Da |
| 749 = f*Sa + f*Da - f*Sa * Da + Da - f*Da | 749 = f*Sa + f*Da - f*Sa * Da + Da - f*Da |
| 750 = f*Sa - f*Sa * Da + Da | 750 = f*Sa - f*Sa * Da + Da |
| 751 = f*Sa + Da - f*Sa * Da | 751 = f*Sa + Da - f*Sa * Da |
| 752 = blend(f*Sa, Da) | 752 = blend(f*Sa, Da) |
| 753 */ | 753 */ |
| 754 | 754 |
| 755 OptFlags flags = kNone_OptFlags; | 755 OptFlags flags = kNone_Opt; |
| 756 if (colorPOI.allStagesMultiplyInput()) { | 756 if (colorPOI.allStagesMultiplyInput()) { |
| 757 flags |= kCanTweakAlphaForCoverage_OptFlag; | 757 flags |= kCanTweakAlphaForCoverage_OptFlag; |
| 758 } | 758 } |
| 759 if (this->hasHWBlendEquation() && coveragePOI.isSolidWhite()) { | 759 if (this->hasHWBlendEquation() && coveragePOI.isSolidWhite()) { |
| 760 flags |= kIgnoreCoverage_OptFlag; | 760 flags |= kIgnoreCoverage_OptFlag; |
| 761 } | 761 } |
| 762 return flags; | 762 return flags; |
| 763 } | 763 } |
| 764 | 764 |
| 765 bool CustomXP::onWillNeedXferBarrier(const GrRenderTarget* rt, | 765 bool CustomXP::onWillNeedXferBarrier(const GrRenderTarget* rt, |
| (...skipping 50 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 |