Remove Ganesh code from SkBlendMode/XferMode

SkBlendMode_AsXPFactory -> GrXferProcessor::FromBlendMode

This removes some unused code leftover from an XferMode -> BlendMode
migration.

Change-Id: I0405b26ed493eebbc335742fdf018ae4b609fab7
Bug: skia:14317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/709204
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/gn/core.gni b/gn/core.gni
index de72d62..86c520f 100644
--- a/gn/core.gni
+++ b/gn/core.gni
@@ -586,7 +586,6 @@
   "$_src/core/SkWritePixelsRec.h",
   "$_src/core/SkWriter32.cpp",
   "$_src/core/SkWriter32.h",
-  "$_src/core/SkXfermode.cpp",
   "$_src/core/SkXfermodeInterpretation.cpp",
   "$_src/core/SkXfermodeInterpretation.h",
   "$_src/core/SkYUVAInfo.cpp",
diff --git a/public.bzl b/public.bzl
index 18438b2..a1f6669 100644
--- a/public.bzl
+++ b/public.bzl
@@ -701,7 +701,6 @@
     "src/core/SkWritePixelsRec.h",
     "src/core/SkWriter32.cpp",
     "src/core/SkWriter32.h",
-    "src/core/SkXfermode.cpp",
     "src/core/SkXfermodeInterpretation.cpp",
     "src/core/SkXfermodeInterpretation.h",
     "src/core/SkYUVAInfo.cpp",
diff --git a/src/core/BUILD.bazel b/src/core/BUILD.bazel
index f09b220..2a5e09e 100644
--- a/src/core/BUILD.bazel
+++ b/src/core/BUILD.bazel
@@ -344,7 +344,6 @@
     "SkWritePixelsRec.h",
     "SkWriter32.cpp",
     "SkWriter32.h",
-    "SkXfermode.cpp",
     "SkXfermodeInterpretation.cpp",
     "SkXfermodeInterpretation.h",
     "SkYUVAInfo.cpp",
diff --git a/src/core/SkBlendMode.cpp b/src/core/SkBlendMode.cpp
index e8b8705..dc44ee3 100644
--- a/src/core/SkBlendMode.cpp
+++ b/src/core/SkBlendMode.cpp
@@ -159,3 +159,40 @@
     p.run(0,0, 1,1);
     return res_storage;
 }
+
+const char* SkBlendMode_Name(SkBlendMode bm) {
+    switch (bm) {
+        case SkBlendMode::kClear:      return "Clear";
+        case SkBlendMode::kSrc:        return "Src";
+        case SkBlendMode::kDst:        return "Dst";
+        case SkBlendMode::kSrcOver:    return "SrcOver";
+        case SkBlendMode::kDstOver:    return "DstOver";
+        case SkBlendMode::kSrcIn:      return "SrcIn";
+        case SkBlendMode::kDstIn:      return "DstIn";
+        case SkBlendMode::kSrcOut:     return "SrcOut";
+        case SkBlendMode::kDstOut:     return "DstOut";
+        case SkBlendMode::kSrcATop:    return "SrcATop";
+        case SkBlendMode::kDstATop:    return "DstATop";
+        case SkBlendMode::kXor:        return "Xor";
+        case SkBlendMode::kPlus:       return "Plus";
+        case SkBlendMode::kModulate:   return "Modulate";
+        case SkBlendMode::kScreen:     return "Screen";
+
+        case SkBlendMode::kOverlay:    return "Overlay";
+        case SkBlendMode::kDarken:     return "Darken";
+        case SkBlendMode::kLighten:    return "Lighten";
+        case SkBlendMode::kColorDodge: return "ColorDodge";
+        case SkBlendMode::kColorBurn:  return "ColorBurn";
+        case SkBlendMode::kHardLight:  return "HardLight";
+        case SkBlendMode::kSoftLight:  return "SoftLight";
+        case SkBlendMode::kDifference: return "Difference";
+        case SkBlendMode::kExclusion:  return "Exclusion";
+        case SkBlendMode::kMultiply:   return "Multiply";
+
+        case SkBlendMode::kHue:        return "Hue";
+        case SkBlendMode::kSaturation: return "Saturation";
+        case SkBlendMode::kColor:      return "Color";
+        case SkBlendMode::kLuminosity: return "Luminosity";
+    }
+    SkUNREACHABLE;
+}
diff --git a/src/core/SkBlendModePriv.h b/src/core/SkBlendModePriv.h
index 1b1a592..b67c6de 100644
--- a/src/core/SkBlendModePriv.h
+++ b/src/core/SkBlendModePriv.h
@@ -32,9 +32,4 @@
 
 SkPMColor4f SkBlendMode_Apply(SkBlendMode, const SkPMColor4f& src, const SkPMColor4f& dst);
 
-#if defined(SK_GANESH)
-#include "src/gpu/ganesh/GrXferProcessor.h"
-const GrXPFactory* SkBlendMode_AsXPFactory(SkBlendMode);
-#endif
-
 #endif
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
deleted file mode 100644
index 8011e27..0000000
--- a/src/core/SkXfermode.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2006 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "include/core/SkBlendMode.h"
-
-#if defined(SK_GANESH)
-#include "src/gpu/ganesh/GrFragmentProcessor.h"
-#include "src/gpu/ganesh/effects/GrCustomXfermode.h"
-#include "src/gpu/ganesh/effects/GrPorterDuffXferProcessor.h"
-#endif
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-const char* SkBlendMode_Name(SkBlendMode bm) {
-    switch (bm) {
-        case SkBlendMode::kClear:      return "Clear";
-        case SkBlendMode::kSrc:        return "Src";
-        case SkBlendMode::kDst:        return "Dst";
-        case SkBlendMode::kSrcOver:    return "SrcOver";
-        case SkBlendMode::kDstOver:    return "DstOver";
-        case SkBlendMode::kSrcIn:      return "SrcIn";
-        case SkBlendMode::kDstIn:      return "DstIn";
-        case SkBlendMode::kSrcOut:     return "SrcOut";
-        case SkBlendMode::kDstOut:     return "DstOut";
-        case SkBlendMode::kSrcATop:    return "SrcATop";
-        case SkBlendMode::kDstATop:    return "DstATop";
-        case SkBlendMode::kXor:        return "Xor";
-        case SkBlendMode::kPlus:       return "Plus";
-        case SkBlendMode::kModulate:   return "Modulate";
-        case SkBlendMode::kScreen:     return "Screen";
-
-        case SkBlendMode::kOverlay:    return "Overlay";
-        case SkBlendMode::kDarken:     return "Darken";
-        case SkBlendMode::kLighten:    return "Lighten";
-        case SkBlendMode::kColorDodge: return "ColorDodge";
-        case SkBlendMode::kColorBurn:  return "ColorBurn";
-        case SkBlendMode::kHardLight:  return "HardLight";
-        case SkBlendMode::kSoftLight:  return "SoftLight";
-        case SkBlendMode::kDifference: return "Difference";
-        case SkBlendMode::kExclusion:  return "Exclusion";
-        case SkBlendMode::kMultiply:   return "Multiply";
-
-        case SkBlendMode::kHue:        return "Hue";
-        case SkBlendMode::kSaturation: return "Saturation";
-        case SkBlendMode::kColor:      return "Color";
-        case SkBlendMode::kLuminosity: return "Luminosity";
-    }
-    SkUNREACHABLE;
-}
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#if defined(SK_GANESH)
-const GrXPFactory* SkBlendMode_AsXPFactory(SkBlendMode mode) {
-    if (SkBlendMode_AsCoeff(mode, nullptr, nullptr)) {
-        const GrXPFactory* result = GrPorterDuffXPFactory::Get(mode);
-        SkASSERT(result);
-        return result;
-    }
-
-    SkASSERT(GrCustomXfermode::IsSupportedMode(mode));
-    return GrCustomXfermode::Get(mode);
-}
-#endif
diff --git a/src/core/SkXfermodePriv.h b/src/core/SkXfermodePriv.h
deleted file mode 100644
index 1bd8f51..0000000
--- a/src/core/SkXfermodePriv.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2006 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkXfermodePriv_DEFINED
-#define SkXfermodePriv_DEFINED
-
-#include "include/core/SkBlendMode.h"
-#include "include/core/SkColor.h"
-#include "include/core/SkRefCnt.h"
-
-class SkXfermode : public SkRefCnt {
-public:
-    virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
-                        const SkAlpha aa[]) const = 0;
-
-    /** Return an SkXfermode object for the specified mode.
-     */
-    static sk_sp<SkXfermode> Make(SkBlendMode);
-
-    /**
-     *  Skia maintains global xfermode objects corresponding to each BlendMode. This returns a
-     *  ptr to that global xfermode (or null if the mode is srcover). Thus the caller may use
-     *  the returned ptr, but it should leave its refcnt untouched.
-     */
-    static SkXfermode* Peek(SkBlendMode mode) {
-        sk_sp<SkXfermode> xfer = Make(mode);
-        if (!xfer) {
-            SkASSERT(SkBlendMode::kSrcOver == mode);
-            return nullptr;
-        }
-        SkASSERT(!xfer->unique());
-        return xfer.get();
-    }
-
-protected:
-    SkXfermode() {}
-};
-
-#endif
diff --git a/src/gpu/ganesh/Device.cpp b/src/gpu/ganesh/Device.cpp
index 0b2763e..510254c 100644
--- a/src/gpu/ganesh/Device.cpp
+++ b/src/gpu/ganesh/Device.cpp
@@ -49,7 +49,6 @@
 #include "include/private/chromium/Slug.h"  // IWYU pragma: keep
 #include "include/private/gpu/ganesh/GrTypesPriv.h"
 #include "src/base/SkTLazy.h"
-#include "src/core/SkBlendModePriv.h"
 #include "src/core/SkDevice.h"
 #include "src/core/SkDrawBase.h"
 #include "src/core/SkImageFilterCache.h"
@@ -85,6 +84,7 @@
 #include "src/gpu/ganesh/GrTextureProxy.h"
 #include "src/gpu/ganesh/GrTracing.h"
 #include "src/gpu/ganesh/GrUserStencilSettings.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/SkGr.h"
 #include "src/gpu/ganesh/SurfaceContext.h"
 #include "src/gpu/ganesh/SurfaceDrawContext.h"
@@ -581,7 +581,7 @@
     GrPaint grPaint;
     grPaint.setColor4f(dstColor);
     if (mode != SkBlendMode::kSrcOver) {
-        grPaint.setXPFactory(SkBlendMode_AsXPFactory(mode));
+        grPaint.setXPFactory(GrXPFactory::FromBlendMode(mode));
     }
 
     if (clip) {
diff --git a/src/gpu/ganesh/GrProcessorSet.cpp b/src/gpu/ganesh/GrProcessorSet.cpp
index 9554a00..23896e4 100644
--- a/src/gpu/ganesh/GrProcessorSet.cpp
+++ b/src/gpu/ganesh/GrProcessorSet.cpp
@@ -4,11 +4,11 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
+#include "src/gpu/ganesh/GrProcessorSet.h"
 
 #include "src/core/SkBlendModePriv.h"
 #include "src/gpu/ganesh/GrAppliedClip.h"
 #include "src/gpu/ganesh/GrCaps.h"
-#include "src/gpu/ganesh/GrProcessorSet.h"
 #include "src/gpu/ganesh/GrUserStencilSettings.h"
 #include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/effects/GrPorterDuffXferProcessor.h"
@@ -29,7 +29,7 @@
     SkDEBUGCODE(paint.fAlive = false;)
 }
 
-GrProcessorSet::GrProcessorSet(SkBlendMode mode) : fXP(SkBlendMode_AsXPFactory(mode)) {}
+GrProcessorSet::GrProcessorSet(SkBlendMode mode) : fXP(GrXPFactory::FromBlendMode(mode)) {}
 
 GrProcessorSet::GrProcessorSet(std::unique_ptr<GrFragmentProcessor> colorFP)
         : fXP((const GrXPFactory*)nullptr) {
diff --git a/src/gpu/ganesh/GrXferProcessor.cpp b/src/gpu/ganesh/GrXferProcessor.cpp
index c1a2d28..f6217ad 100644
--- a/src/gpu/ganesh/GrXferProcessor.cpp
+++ b/src/gpu/ganesh/GrXferProcessor.cpp
@@ -7,11 +7,18 @@
 
 #include "src/gpu/ganesh/GrXferProcessor.h"
 
+#include "include/core/SkBlendMode.h"
+#include "include/core/SkString.h"
 #include "src/gpu/KeyBuilder.h"
 #include "src/gpu/ganesh/GrCaps.h"
-#include "src/gpu/ganesh/GrPipeline.h"
+#include "src/gpu/ganesh/GrShaderCaps.h"
+#include "src/gpu/ganesh/effects/GrCustomXfermode.h"
+#include "src/gpu/ganesh/effects/GrPorterDuffXferProcessor.h"
 #include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
-#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
+
+#include <cstdint>
+
+enum class GrClampType;
 
 GrXferProcessor::GrXferProcessor(ClassID classID)
         : INHERITED(classID)
@@ -92,6 +99,17 @@
     }
 }
 
+const GrXPFactory* GrXPFactory::FromBlendMode(SkBlendMode mode) {
+    if (SkBlendMode_AsCoeff(mode, nullptr, nullptr)) {
+        const GrXPFactory* result = GrPorterDuffXPFactory::Get(mode);
+        SkASSERT(result);
+        return result;
+    }
+
+    SkASSERT(GrCustomXfermode::IsSupportedMode(mode));
+    return GrCustomXfermode::Get(mode);
+}
+
 //////////////////////////////////////////////////////////////////////////////
 
 using ProgramImpl = GrXferProcessor::ProgramImpl;
diff --git a/src/gpu/ganesh/GrXferProcessor.h b/src/gpu/ganesh/GrXferProcessor.h
index 1cecda3..85fada5 100644
--- a/src/gpu/ganesh/GrXferProcessor.h
+++ b/src/gpu/ganesh/GrXferProcessor.h
@@ -8,19 +8,27 @@
 #ifndef GrXferProcessor_DEFINED
 #define GrXferProcessor_DEFINED
 
+#include "include/core/SkRefCnt.h"
 #include "include/gpu/GrTypes.h"
+#include "include/private/base/SkAssert.h"
+#include "include/private/base/SkTo.h"
 #include "src/gpu/Blend.h"
+#include "src/gpu/Swizzle.h"
+#include "src/gpu/ganesh/GrCaps.h"
 #include "src/gpu/ganesh/GrNonAtomicRef.h"
 #include "src/gpu/ganesh/GrProcessor.h"
 #include "src/gpu/ganesh/GrProcessorAnalysis.h"
 #include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
 
-class GrGLSLXPFragmentBuilder;
+#include <memory>
+
 class GrGLSLProgramDataManager;
+class GrGLSLXPFragmentBuilder;
+enum class GrClampType;
+enum class SkBlendMode;
+namespace skgpu { class KeyBuilder; }
 struct GrShaderCaps;
-namespace skgpu {
-    class KeyBuilder;
-}
+
 /**
  * Barriers for blending. When a shader reads the dst directly, an Xfer barrier is sometimes
  * required after a pixel has been written, before it can be safely read again.
@@ -46,7 +54,7 @@
  * GrXferProcessor is responsible for implementing the xfer mode that blends the src color and dst
  * color, and for applying any coverage. It does this by emitting fragment shader code and
  * controlling the fixed-function blend state. When dual-source blending is available, it may also
- * write a seconday fragment shader output color. GrXferProcessor has two modes of operation:
+ * write a secondary fragment shader output color. GrXferProcessor has two modes of operation:
  *
  * Dst read: When allowed by the backend API, or when supplied a texture of the destination, the
  * GrXferProcessor may read the destination color. While operating in this mode, the subclass only
@@ -240,6 +248,8 @@
                                                     const GrCaps&,
                                                     GrClampType);
 
+    static const GrXPFactory* FromBlendMode(SkBlendMode);
+
 protected:
     constexpr GrXPFactory() {}
 
diff --git a/src/gpu/ganesh/SkGr.cpp b/src/gpu/ganesh/SkGr.cpp
index c134215..e70695c 100644
--- a/src/gpu/ganesh/SkGr.cpp
+++ b/src/gpu/ganesh/SkGr.cpp
@@ -25,7 +25,6 @@
 #include "include/private/SkIDChangeListener.h"
 #include "include/private/base/SkTPin.h"
 #include "include/private/gpu/ganesh/GrTypesPriv.h"
-#include "src/core/SkBlendModePriv.h"
 #include "src/core/SkBlenderBase.h"
 #include "src/core/SkMessageBus.h"
 #include "src/core/SkPaintPriv.h"
@@ -45,6 +44,7 @@
 #include "src/gpu/ganesh/GrSurfaceProxy.h"
 #include "src/gpu/ganesh/GrSurfaceProxyView.h"
 #include "src/gpu/ganesh/GrTextureProxy.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/effects/GrSkSLFP.h"
 #include "src/gpu/ganesh/effects/GrTextureEffect.h"
 #include "src/shaders/SkShaderBase.h"
@@ -507,7 +507,7 @@
         // on the GrPaint to also be null (also kSrcOver).
         SkASSERT(!grPaint->getXPFactory());
         if (bm.value() != SkBlendMode::kSrcOver) {
-            grPaint->setXPFactory(SkBlendMode_AsXPFactory(bm.value()));
+            grPaint->setXPFactory(GrXPFactory::FromBlendMode(bm.value()));
         }
     } else {
         // Apply a custom blend against the surface color, and force the XP to kSrc so that the
@@ -519,7 +519,7 @@
         if (!paintFP) {
             return false;
         }
-        grPaint->setXPFactory(SkBlendMode_AsXPFactory(SkBlendMode::kSrc));
+        grPaint->setXPFactory(GrXPFactory::FromBlendMode(SkBlendMode::kSrc));
     }
 
     if (GrColorTypeClampType(dstColorInfo.colorType()) == GrClampType::kManual) {
diff --git a/src/gpu/ganesh/SurfaceDrawContext.cpp b/src/gpu/ganesh/SurfaceDrawContext.cpp
index ccc46b9..a42b944 100644
--- a/src/gpu/ganesh/SurfaceDrawContext.cpp
+++ b/src/gpu/ganesh/SurfaceDrawContext.cpp
@@ -50,6 +50,7 @@
 #include "src/gpu/ganesh/GrStencilSettings.h"
 #include "src/gpu/ganesh/GrStyle.h"
 #include "src/gpu/ganesh/GrTracing.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/PathRenderer.h"
 #include "src/gpu/ganesh/SkGr.h"
 #include "src/gpu/ganesh/effects/GrBlendFragmentProcessor.h"
@@ -596,7 +597,7 @@
         fp = GrBlendFragmentProcessor::Make<SkBlendMode::kModulate>(std::move(fp), nullptr);
         paint.setColorFragmentProcessor(std::move(fp));
         if (blendMode != SkBlendMode::kSrcOver) {
-            paint.setXPFactory(SkBlendMode_AsXPFactory(blendMode));
+            paint.setXPFactory(GrXPFactory::FromBlendMode(blendMode));
         }
         this->fillRectToRect(clip, std::move(paint), GrAA::kYes, viewMatrix, dstRect, srcRect);
         return;
diff --git a/src/gpu/ganesh/ops/AtlasRenderTask.cpp b/src/gpu/ganesh/ops/AtlasRenderTask.cpp
index b5a6be2..fec7012 100644
--- a/src/gpu/ganesh/ops/AtlasRenderTask.cpp
+++ b/src/gpu/ganesh/ops/AtlasRenderTask.cpp
@@ -14,6 +14,7 @@
 #include "src/gpu/ganesh/GrOpFlushState.h"
 #include "src/gpu/ganesh/GrOpsTypes.h"
 #include "src/gpu/ganesh/GrSurfaceProxyPriv.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/geometry/GrQuad.h"
 #include "src/gpu/ganesh/ops/FillRectOp.h"
 #include "src/gpu/ganesh/ops/PathStencilCoverOp.h"
@@ -154,7 +155,7 @@
                                        const GrUserStencilSettings* stencil) {
     GrPaint paint;
     paint.setColor4f(color);
-    paint.setXPFactory(SkBlendMode_AsXPFactory(SkBlendMode::kSrc));
+    paint.setXPFactory(GrXPFactory::FromBlendMode(SkBlendMode::kSrc));
     GrQuad quad(rect);
     DrawQuad drawQuad{quad, quad, GrQuadAAFlags::kAll};
     auto op = FillRectOp::Make(rContext, std::move(paint), GrAAType::kMSAA, &drawQuad, stencil);
diff --git a/src/gpu/ganesh/ops/TextureOp.cpp b/src/gpu/ganesh/ops/TextureOp.cpp
index 150af2f..740891f 100644
--- a/src/gpu/ganesh/ops/TextureOp.cpp
+++ b/src/gpu/ganesh/ops/TextureOp.cpp
@@ -30,6 +30,7 @@
 #include "src/gpu/ganesh/GrShaderCaps.h"
 #include "src/gpu/ganesh/GrTexture.h"
 #include "src/gpu/ganesh/GrTextureProxy.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/SkGr.h"
 #include "src/gpu/ganesh/SurfaceDrawContext.h"
 #include "src/gpu/ganesh/effects/GrBlendFragmentProcessor.h"
@@ -1181,7 +1182,7 @@
         GrSamplerState samplerState(GrSamplerState::WrapMode::kClamp, filter, mm);
         GrPaint paint;
         paint.setColor4f(color);
-        paint.setXPFactory(SkBlendMode_AsXPFactory(blendMode));
+        paint.setXPFactory(GrXPFactory::FromBlendMode(blendMode));
 
         std::unique_ptr<GrFragmentProcessor> fp;
         const auto& caps = *context->priv().caps();
diff --git a/tests/BulkRectTest.cpp b/tests/BulkRectTest.cpp
index 6369352..b3fdaef 100644
--- a/tests/BulkRectTest.cpp
+++ b/tests/BulkRectTest.cpp
@@ -23,7 +23,6 @@
 #include "include/gpu/GrTypes.h"
 #include "include/private/SkColorData.h"
 #include "include/private/gpu/ganesh/GrTypesPriv.h"
-#include "src/core/SkBlendModePriv.h"
 #include "src/gpu/SkBackingFit.h"
 #include "src/gpu/Swizzle.h"
 #include "src/gpu/ganesh/GrCaps.h"
@@ -37,6 +36,7 @@
 #include "src/gpu/ganesh/GrSamplerState.h"
 #include "src/gpu/ganesh/GrSurfaceProxy.h"
 #include "src/gpu/ganesh/GrSurfaceProxyView.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/SurfaceDrawContext.h"
 #include "src/gpu/ganesh/geometry/GrQuad.h"
 #include "src/gpu/ganesh/ops/FillRectOp.h"
@@ -118,7 +118,7 @@
     }
 
     GrPaint paint;
-    paint.setXPFactory(SkBlendMode_AsXPFactory(blendMode));
+    paint.setXPFactory(GrXPFactory::FromBlendMode(blendMode));
 
     skgpu::ganesh::FillRectOp::AddFillRectOps(sdc.get(),
                                               nullptr,
diff --git a/tests/DMSAATest.cpp b/tests/DMSAATest.cpp
index 9869853..6f642e8 100644
--- a/tests/DMSAATest.cpp
+++ b/tests/DMSAATest.cpp
@@ -40,6 +40,7 @@
 #include "src/gpu/SkBackingFit.h"
 #include "src/gpu/ganesh/GrPaint.h"
 #include "src/gpu/ganesh/GrPixmap.h"
+#include "src/gpu/ganesh/GrXferProcessor.h"
 #include "src/gpu/ganesh/SurfaceDrawContext.h"
 #include "tests/CtsEnforcement.h"
 #include "tests/Test.h"
@@ -64,7 +65,7 @@
                                SkBlendMode blendMode) {
     GrPaint paint;
     paint.setColor4f(color);
-    paint.setXPFactory(SkBlendMode_AsXPFactory(blendMode));
+    paint.setXPFactory(GrXPFactory::FromBlendMode(blendMode));
     sdc->drawRect(nullptr, std::move(paint), GrAA::kYes, SkMatrix::I(),
                   SkRect::MakeIWH(kWidth, kHeight), nullptr);
 }
@@ -81,7 +82,7 @@
 
     GrPaint paint;
     paint.setColor4f(color);
-    paint.setXPFactory(SkBlendMode_AsXPFactory(blendMode));
+    paint.setXPFactory(GrXPFactory::FromBlendMode(blendMode));
     sdc->drawVertices(nullptr, std::move(paint), SkMatrixProvider(SkMatrix::I()), vertices);
 }
 
diff --git a/toolchain/linux_trampolines/clang_trampoline_linux.sh b/toolchain/linux_trampolines/clang_trampoline_linux.sh
index 97304a9..8198209 100755
--- a/toolchain/linux_trampolines/clang_trampoline_linux.sh
+++ b/toolchain/linux_trampolines/clang_trampoline_linux.sh
@@ -117,6 +117,7 @@
   "src/gpu/ganesh/GrSurfaceProxy.cpp"
   "src/gpu/ganesh/GrSurfaceProxyView.cpp"
   "src/gpu/ganesh/GrTextureProxy.cpp"
+  "src/gpu/ganesh/GrXferProcessor.cpp"
   "src/gpu/ganesh/SkGr.cpp"
   "src/gpu/ganesh/effects/GrPerlinNoise2Effect.cpp"
   "src/pdf/SkJpeg"