aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrPaint.h6
-rw-r--r--include/gpu/effects/GrPorterDuffXferProcessor.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 6120348792..a8af3c2f17 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -16,9 +16,9 @@
#include "effects/GrPorterDuffXferProcessor.h"
#include "GrFragmentProcessor.h"
+#include "SkBlendMode.h"
#include "SkRefCnt.h"
#include "SkRegion.h"
-#include "SkXfermode.h"
/**
* The paint describes how color and coverage are computed at each pixel by GrContext draw
@@ -95,6 +95,10 @@ public:
fXPFactory = std::move(xpFactory);
}
+ void setPorterDuffXPFactory(SkBlendMode mode) {
+ fXPFactory = GrPorterDuffXPFactory::Make((SkXfermode::Mode)mode);
+ }
+
void setPorterDuffXPFactory(SkXfermode::Mode mode) {
fXPFactory = GrPorterDuffXPFactory::Make(mode);
}
diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h
index 8399d5805e..6777d76046 100644
--- a/include/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/include/gpu/effects/GrPorterDuffXferProcessor.h
@@ -17,6 +17,9 @@ class GrProcOptInfo;
class GrPorterDuffXPFactory : public GrXPFactory {
public:
static sk_sp<GrXPFactory> Make(SkXfermode::Mode mode);
+ static sk_sp<GrXPFactory> Make(SkBlendMode mode) {
+ return Make((SkXfermode::Mode)mode);
+ }
void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
GrXPFactory::InvariantBlendedColor*) const override;