Index: src/gpu/effects/GrPorterDuffXferProcessor.cpp |
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
index fdbcbbe656d266305cc08612a85dc0e2f22c6abd..1f50f9d52420691ac05813f63b823a210ed55103 100644 |
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
@@ -61,6 +61,88 @@ void GrPorterDuffXferProcessor::onComputeInvariantOutput(GrInvariantOutput* inou |
/////////////////////////////////////////////////////////////////////////////// |
+GrXPFactory* GrPorterDuffXPFactory::Create(SkXfermode::Mode mode) { |
+ switch (mode) { |
+ case SkXfermode::kClear_Mode: { |
+ static GrPorterDuffXPFactory gClearPDXPF(kZero_GrBlendCoeff, kZero_GrBlendCoeff); |
+ return SkRef(&gClearPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kSrc_Mode: { |
+ static GrPorterDuffXPFactory gSrcPDXPF(kOne_GrBlendCoeff, kZero_GrBlendCoeff); |
+ return SkRef(&gSrcPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kDst_Mode: { |
+ static GrPorterDuffXPFactory gDstPDXPF(kZero_GrBlendCoeff, kOne_GrBlendCoeff); |
+ return SkRef(&gDstPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kSrcOver_Mode: { |
+ static GrPorterDuffXPFactory gSrcOverPDXPF(kOne_GrBlendCoeff, kISA_GrBlendCoeff); |
+ return SkRef(&gSrcOverPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kDstOver_Mode: { |
+ static GrPorterDuffXPFactory gDstOverPDXPF(kIDA_GrBlendCoeff, kOne_GrBlendCoeff); |
+ return SkRef(&gDstOverPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kSrcIn_Mode: { |
+ static GrPorterDuffXPFactory gSrcInPDXPF(kDA_GrBlendCoeff, kZero_GrBlendCoeff); |
+ return SkRef(&gSrcInPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kDstIn_Mode: { |
+ static GrPorterDuffXPFactory gDstInPDXPF(kZero_GrBlendCoeff, kSA_GrBlendCoeff); |
+ return SkRef(&gDstInPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kSrcOut_Mode: { |
+ static GrPorterDuffXPFactory gSrcOutPDXPF(kIDA_GrBlendCoeff, kZero_GrBlendCoeff); |
+ return SkRef(&gSrcOutPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kDstOut_Mode: { |
+ static GrPorterDuffXPFactory gDstOutPDXPF(kZero_GrBlendCoeff, kISA_GrBlendCoeff); |
+ return SkRef(&gDstOutPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kSrcATop_Mode: { |
+ static GrPorterDuffXPFactory gSrcATopPDXPF(kDA_GrBlendCoeff, kISA_GrBlendCoeff); |
+ return SkRef(&gSrcATopPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kDstATop_Mode: { |
+ static GrPorterDuffXPFactory gDstATopPDXPF(kIDA_GrBlendCoeff, kSA_GrBlendCoeff); |
+ return SkRef(&gDstATopPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kXor_Mode: { |
+ static GrPorterDuffXPFactory gXorPDXPF(kIDA_GrBlendCoeff, kISA_GrBlendCoeff); |
+ return SkRef(&gXorPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kPlus_Mode: { |
+ static GrPorterDuffXPFactory gPlusPDXPF(kOne_GrBlendCoeff, kOne_GrBlendCoeff); |
+ return SkRef(&gPlusPDXPF); |
+ break; |
+ } |
+ case SkXfermode::kModulate_Mode: { |
+ static GrPorterDuffXPFactory gModulatePDXPF(kZero_GrBlendCoeff, kSC_GrBlendCoeff); |
+ return SkRef(&gModulatePDXPF); |
+ break; |
+ } |
+ case SkXfermode::kScreen_Mode: { |
+ static GrPorterDuffXPFactory gScreenPDXPF(kOne_GrBlendCoeff, kISC_GrBlendCoeff); |
+ return SkRef(&gScreenPDXPF); |
+ break; |
+ } |
+ default: |
+ return NULL; |
+ } |
+} |
+ |
const GrXferProcessor* GrPorterDuffXPFactory::createXferProcessor() const { |
return GrPorterDuffXferProcessor::Create(fSrc, fDst); |
} |