aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrXferProcessor.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-04-04 15:17:03 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-04 20:07:34 +0000
commita076d8711d24b8181f894038a4fd34d5327f1717 (patch)
treea21a88286fd99db304441440a22341bc1daea2fa /src/gpu/GrXferProcessor.h
parenta08104abf2850546d97c5d33f5fb5fabedf45466 (diff)
Use sk_sp with GrXferProcessor and use a static factory to handle the nullptr==srcover case.
Bug: skia: Change-Id: I9c07069fc2aae24fc2884c18939e3a649afc27e7 Reviewed-on: https://skia-review.googlesource.com/11282 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrXferProcessor.h')
-rw-r--r--src/gpu/GrXferProcessor.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gpu/GrXferProcessor.h b/src/gpu/GrXferProcessor.h
index b65a125ca3..bfc6dd71c5 100644
--- a/src/gpu/GrXferProcessor.h
+++ b/src/gpu/GrXferProcessor.h
@@ -236,11 +236,6 @@ class GrXPFactory {
public:
typedef GrXferProcessor::DstTexture DstTexture;
- GrXferProcessor* createXferProcessor(const GrProcessorAnalysisColor&,
- GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
- const GrCaps& caps) const;
-
enum class AnalysisProperties : unsigned {
kNone = 0x0,
/**
@@ -273,6 +268,12 @@ public:
};
GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(AnalysisProperties);
+ static sk_sp<GrXferProcessor> MakeXferProcessor(const GrXPFactory*,
+ const GrProcessorAnalysisColor&,
+ GrProcessorAnalysisCoverage,
+ bool hasMixedSamples,
+ const GrCaps& caps);
+
static AnalysisProperties GetAnalysisProperties(const GrXPFactory*,
const GrProcessorAnalysisColor&,
const GrProcessorAnalysisCoverage&,
@@ -282,10 +283,10 @@ protected:
constexpr GrXPFactory() {}
private:
- virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
- const GrProcessorAnalysisColor&,
- GrProcessorAnalysisCoverage,
- bool hasMixedSamples) const = 0;
+ virtual sk_sp<GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&,
+ GrProcessorAnalysisCoverage,
+ bool hasMixedSamples,
+ const GrCaps&) const = 0;
/**
* Subclass analysis implementation. This should not return kNeedsDstInTexture as that will be