wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "effects/GrXfermodeFragmentProcessor.h" |
| 9 | |
| 10 | #include "GrFragmentProcessor.h" |
| 11 | #include "effects/GrConstColorProcessor.h" |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 12 | #include "glsl/GrGLSLFragmentProcessor.h" |
| 13 | #include "glsl/GrGLSLBlend.h" |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 14 | #include "glsl/GrGLSLFragmentShaderBuilder.h" |
| 15 | #include "glsl/GrGLSLProgramBuilder.h" |
bsalomon | f276ac5 | 2015-10-09 13:36:42 -0700 | [diff] [blame] | 16 | #include "SkGrPriv.h" |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 17 | |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 18 | class ComposeTwoFragmentProcessor : public GrFragmentProcessor { |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 19 | public: |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 20 | ComposeTwoFragmentProcessor(const GrFragmentProcessor* src, const GrFragmentProcessor* dst, |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 21 | SkXfermode::Mode mode) |
| 22 | : fMode(mode) { |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 23 | this->initClassID<ComposeTwoFragmentProcessor>(); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 24 | SkDEBUGCODE(int shaderAChildIndex = )this->registerChildProcessor(src); |
| 25 | SkDEBUGCODE(int shaderBChildIndex = )this->registerChildProcessor(dst); |
| 26 | SkASSERT(0 == shaderAChildIndex); |
| 27 | SkASSERT(1 == shaderBChildIndex); |
| 28 | } |
| 29 | |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 30 | const char* name() const override { return "ComposeTwo"; } |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 31 | |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame^] | 32 | void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 33 | b->add32(fMode); |
| 34 | } |
| 35 | |
| 36 | SkXfermode::Mode getMode() const { return fMode; } |
| 37 | |
| 38 | protected: |
| 39 | bool onIsEqual(const GrFragmentProcessor& other) const override { |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 40 | const ComposeTwoFragmentProcessor& cs = other.cast<ComposeTwoFragmentProcessor>(); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 41 | return fMode == cs.fMode; |
| 42 | } |
| 43 | |
| 44 | void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
| 45 | inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
| 46 | } |
| 47 | |
| 48 | private: |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame^] | 49 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 50 | |
| 51 | SkXfermode::Mode fMode; |
| 52 | |
| 53 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 54 | |
| 55 | typedef GrFragmentProcessor INHERITED; |
| 56 | }; |
| 57 | |
| 58 | ///////////////////////////////////////////////////////////////////// |
| 59 | |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 60 | class GLComposeTwoFragmentProcessor : public GrGLSLFragmentProcessor { |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 61 | public: |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 62 | GLComposeTwoFragmentProcessor(const GrProcessor& processor) {} |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 63 | |
| 64 | void emitCode(EmitArgs&) override; |
| 65 | |
| 66 | private: |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 67 | typedef GrGLSLFragmentProcessor INHERITED; |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | ///////////////////////////////////////////////////////////////////// |
| 71 | |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 72 | GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ComposeTwoFragmentProcessor); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 73 | |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 74 | const GrFragmentProcessor* ComposeTwoFragmentProcessor::TestCreate(GrProcessorTestData* d) { |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 75 | // Create two random frag procs. |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 76 | SkAutoTUnref<const GrFragmentProcessor> fpA(GrProcessorUnitTest::CreateChildFP(d)); |
| 77 | SkAutoTUnref<const GrFragmentProcessor> fpB(GrProcessorUnitTest::CreateChildFP(d)); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 78 | |
| 79 | SkXfermode::Mode mode = static_cast<SkXfermode::Mode>( |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 80 | d->fRandom->nextRangeU(0, SkXfermode::kLastMode)); |
| 81 | return new ComposeTwoFragmentProcessor(fpA, fpB, mode); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 82 | } |
| 83 | |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame^] | 84 | GrGLSLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLSLInstance() const{ |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 85 | return new GLComposeTwoFragmentProcessor(*this); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | ///////////////////////////////////////////////////////////////////// |
| 89 | |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 90 | void GLComposeTwoFragmentProcessor::emitCode(EmitArgs& args) { |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 91 | |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 92 | GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder(); |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 93 | const ComposeTwoFragmentProcessor& cs = args.fFp.cast<ComposeTwoFragmentProcessor>(); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 94 | |
bsalomon | f1b7a1d | 2015-09-28 06:26:28 -0700 | [diff] [blame] | 95 | const char* inputColor = nullptr; |
bsalomon | b5b6032 | 2015-09-14 12:26:33 -0700 | [diff] [blame] | 96 | if (args.fInputColor) { |
bsalomon | f1b7a1d | 2015-09-28 06:26:28 -0700 | [diff] [blame] | 97 | inputColor = "inputColor"; |
| 98 | fsBuilder->codeAppendf("vec4 inputColor = vec4(%s.rgb, 1.0);", args.fInputColor); |
bsalomon | b5b6032 | 2015-09-14 12:26:33 -0700 | [diff] [blame] | 99 | } |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 100 | |
| 101 | // declare outputColor and emit the code for each of the two children |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 102 | SkString srcColor("src"); |
bsalomon | f1b7a1d | 2015-09-28 06:26:28 -0700 | [diff] [blame] | 103 | this->emitChild(0, inputColor, &srcColor, args); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 104 | |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 105 | SkString dstColor("dst"); |
bsalomon | f1b7a1d | 2015-09-28 06:26:28 -0700 | [diff] [blame] | 106 | this->emitChild(1, inputColor, &dstColor, args); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 107 | |
| 108 | // emit blend code |
| 109 | SkXfermode::Mode mode = cs.getMode(); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 110 | fsBuilder->codeAppendf("// Compose Xfer Mode: %s\n", SkXfermode::ModeName(mode)); |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 111 | GrGLSLBlend::AppendMode(fsBuilder, srcColor.c_str(), dstColor.c_str(), args.fOutputColor, mode); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 112 | |
| 113 | // re-multiply the output color by the input color's alpha |
bsalomon | f1b7a1d | 2015-09-28 06:26:28 -0700 | [diff] [blame] | 114 | if (args.fInputColor) { |
| 115 | fsBuilder->codeAppendf("%s *= %s.a;", args.fOutputColor, args.fInputColor); |
bsalomon | b5b6032 | 2015-09-14 12:26:33 -0700 | [diff] [blame] | 116 | } |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 117 | } |
| 118 | |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 119 | const GrFragmentProcessor* GrXfermodeFragmentProcessor::CreateFromTwoProcessors( |
| 120 | const GrFragmentProcessor* src, const GrFragmentProcessor* dst, SkXfermode::Mode mode) { |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 121 | switch (mode) { |
| 122 | case SkXfermode::kClear_Mode: |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 123 | return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK, |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 124 | GrConstColorProcessor::kIgnore_InputMode); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 125 | case SkXfermode::kSrc_Mode: |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 126 | return SkRef(src); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 127 | case SkXfermode::kDst_Mode: |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 128 | return SkRef(dst); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 129 | default: |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 130 | return new ComposeTwoFragmentProcessor(src, dst, mode); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | ////////////////////////////////////////////////////////////////////////////// |
| 135 | |
| 136 | class ComposeOneFragmentProcessor : public GrFragmentProcessor { |
| 137 | public: |
| 138 | enum Child { |
| 139 | kDst_Child, |
| 140 | kSrc_Child, |
| 141 | }; |
| 142 | |
| 143 | ComposeOneFragmentProcessor(const GrFragmentProcessor* dst, SkXfermode::Mode mode, Child child) |
| 144 | : fMode(mode) |
| 145 | , fChild(child) { |
| 146 | this->initClassID<ComposeOneFragmentProcessor>(); |
| 147 | SkDEBUGCODE(int dstIndex = )this->registerChildProcessor(dst); |
| 148 | SkASSERT(0 == dstIndex); |
| 149 | } |
| 150 | |
| 151 | const char* name() const override { return "ComposeOne"; } |
| 152 | |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame^] | 153 | void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 154 | GR_STATIC_ASSERT((SkXfermode::kLastMode & SK_MaxU16) == SkXfermode::kLastMode); |
| 155 | b->add32(fMode | (fChild << 16)); |
| 156 | } |
| 157 | |
| 158 | SkXfermode::Mode mode() const { return fMode; } |
| 159 | |
| 160 | Child child() const { return fChild; } |
| 161 | |
| 162 | protected: |
| 163 | bool onIsEqual(const GrFragmentProcessor& that) const override { |
| 164 | return fMode == that.cast<ComposeOneFragmentProcessor>().fMode; |
| 165 | } |
| 166 | |
| 167 | void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
| 168 | SkXfermode::Coeff skSrcCoeff, skDstCoeff; |
| 169 | if (SkXfermode::ModeAsCoeff(fMode, &skSrcCoeff, &skDstCoeff)) { |
| 170 | GrBlendCoeff srcCoeff = SkXfermodeCoeffToGrBlendCoeff(skSrcCoeff); |
| 171 | GrBlendCoeff dstCoeff = SkXfermodeCoeffToGrBlendCoeff(skDstCoeff); |
| 172 | GrInvariantOutput childOutput(0xFFFFFFFF, kRGBA_GrColorComponentFlags, false); |
| 173 | this->childProcessor(0).computeInvariantOutput(&childOutput); |
| 174 | GrColor blendColor; |
| 175 | GrColorComponentFlags blendFlags; |
| 176 | if (kDst_Child == fChild) { |
| 177 | GrGetCoeffBlendKnownComponents(srcCoeff, dstCoeff, |
| 178 | inout->color(), inout->validFlags(), |
| 179 | childOutput.color(), childOutput.validFlags(), |
| 180 | &blendColor, &blendFlags); |
| 181 | } else { |
| 182 | GrGetCoeffBlendKnownComponents(srcCoeff, dstCoeff, |
| 183 | childOutput.color(), childOutput.validFlags(), |
| 184 | inout->color(), inout->validFlags(), |
| 185 | &blendColor, &blendFlags); |
| 186 | } |
| 187 | // will the shader code reference the input color? |
| 188 | GrInvariantOutput::ReadInput readsInput = GrInvariantOutput::kWillNot_ReadInput; |
| 189 | if (kDst_Child == fChild) { |
| 190 | if (kZero_GrBlendCoeff != srcCoeff || GrBlendCoeffRefsSrc(dstCoeff)) { |
| 191 | readsInput = GrInvariantOutput::kWill_ReadInput; |
| 192 | } |
| 193 | } else { |
| 194 | if (kZero_GrBlendCoeff != dstCoeff || GrBlendCoeffRefsDst(srcCoeff)) { |
| 195 | readsInput = GrInvariantOutput::kWill_ReadInput; |
| 196 | } |
| 197 | } |
| 198 | inout->setToOther(blendFlags, blendColor, readsInput); |
| 199 | } else { |
| 200 | inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | private: |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame^] | 205 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 206 | |
| 207 | SkXfermode::Mode fMode; |
| 208 | Child fChild; |
| 209 | |
| 210 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 211 | |
| 212 | typedef GrFragmentProcessor INHERITED; |
| 213 | }; |
| 214 | |
| 215 | ////////////////////////////////////////////////////////////////////////////// |
| 216 | |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 217 | class GLComposeOneFragmentProcessor : public GrGLSLFragmentProcessor { |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 218 | public: |
| 219 | GLComposeOneFragmentProcessor(const GrProcessor& processor) {} |
| 220 | |
| 221 | void emitCode(EmitArgs& args) override { |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 222 | GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder(); |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 223 | SkXfermode::Mode mode = args.fFp.cast<ComposeOneFragmentProcessor>().mode(); |
| 224 | ComposeOneFragmentProcessor::Child child = |
| 225 | args.fFp.cast<ComposeOneFragmentProcessor>().child(); |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 226 | SkString childColor("child"); |
| 227 | this->emitChild(0, nullptr, &childColor, args); |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 228 | |
| 229 | const char* inputColor = args.fInputColor; |
| 230 | // We don't try to optimize for this case at all |
| 231 | if (!inputColor) { |
| 232 | fsBuilder->codeAppendf("const vec4 ones = vec4(1);"); |
| 233 | inputColor = "ones"; |
| 234 | } |
| 235 | |
| 236 | // emit blend code |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 237 | fsBuilder->codeAppendf("// Compose Xfer Mode: %s\n", SkXfermode::ModeName(mode)); |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 238 | const char* childStr = childColor.c_str(); |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 239 | if (ComposeOneFragmentProcessor::kDst_Child == child) { |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 240 | GrGLSLBlend::AppendMode(fsBuilder, inputColor, childStr, args.fOutputColor, mode); |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 241 | } else { |
bsalomon | 38ddbad | 2015-09-24 06:00:00 -0700 | [diff] [blame] | 242 | GrGLSLBlend::AppendMode(fsBuilder, childStr, inputColor, args.fOutputColor, mode); |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 243 | } |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | private: |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 247 | typedef GrGLSLFragmentProcessor INHERITED; |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 248 | }; |
| 249 | |
| 250 | ///////////////////////////////////////////////////////////////////// |
| 251 | |
| 252 | GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ComposeOneFragmentProcessor); |
| 253 | |
| 254 | const GrFragmentProcessor* ComposeOneFragmentProcessor::TestCreate(GrProcessorTestData* d) { |
| 255 | // Create one random frag procs. |
| 256 | // For now, we'll prevent either children from being a shader with children to prevent the |
| 257 | // possibility of an arbitrarily large tree of procs. |
| 258 | SkAutoTUnref<const GrFragmentProcessor> dst(GrProcessorUnitTest::CreateChildFP(d)); |
| 259 | SkXfermode::Mode mode = static_cast<SkXfermode::Mode>( |
| 260 | d->fRandom->nextRangeU(0, SkXfermode::kLastMode)); |
| 261 | ComposeOneFragmentProcessor::Child child = d->fRandom->nextBool() ? |
| 262 | ComposeOneFragmentProcessor::kDst_Child : |
| 263 | ComposeOneFragmentProcessor::kSrc_Child; |
| 264 | return new ComposeOneFragmentProcessor(dst, mode, child); |
| 265 | } |
| 266 | |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame^] | 267 | GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLSLInstance() const { |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 268 | return new GLComposeOneFragmentProcessor(*this); |
| 269 | } |
| 270 | |
| 271 | ////////////////////////////////////////////////////////////////////////////// |
| 272 | |
| 273 | const GrFragmentProcessor* GrXfermodeFragmentProcessor::CreateFromDstProcessor( |
| 274 | const GrFragmentProcessor* dst, SkXfermode::Mode mode) { |
| 275 | switch (mode) { |
| 276 | case SkXfermode::kClear_Mode: |
| 277 | return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK, |
| 278 | GrConstColorProcessor::kIgnore_InputMode); |
| 279 | case SkXfermode::kSrc_Mode: |
| 280 | return nullptr; |
| 281 | default: |
| 282 | return new ComposeOneFragmentProcessor(dst, mode, |
| 283 | ComposeOneFragmentProcessor::kDst_Child); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | const GrFragmentProcessor* GrXfermodeFragmentProcessor::CreateFromSrcProcessor( |
| 288 | const GrFragmentProcessor* src, SkXfermode::Mode mode) { |
| 289 | switch (mode) { |
| 290 | case SkXfermode::kClear_Mode: |
| 291 | return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK, |
| 292 | GrConstColorProcessor::kIgnore_InputMode); |
| 293 | case SkXfermode::kDst_Mode: |
| 294 | return nullptr; |
| 295 | default: |
| 296 | return new ComposeOneFragmentProcessor(src, mode, |
| 297 | ComposeOneFragmentProcessor::kSrc_Child); |
wangyix | 809e5af | 2015-09-09 12:58:32 -0700 | [diff] [blame] | 298 | } |
| 299 | } |