aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.cpp
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/GrPipeline.cpp
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/GrPipeline.cpp')
-rw-r--r--src/gpu/GrPipeline.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index f48162c86b..759f97ce2c 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -54,17 +54,9 @@ void GrPipeline::init(const InitArgs& args) {
{
bool hasMixedSamples =
args.fRenderTarget->isMixedSampled() && (isHWAA || this->isStencilEnabled());
- sk_sp<GrXferProcessor> xferProcessor;
- const GrXPFactory* xpFactory = args.fProcessors->xpFactory();
- if (xpFactory) {
- xferProcessor.reset(xpFactory->createXferProcessor(
- args.fXPInputColor, args.fXPInputCoverage, hasMixedSamples, *args.fCaps));
- SkASSERT(xferProcessor);
- } else {
- // This may return nullptr in the common case of src-over implemented using hw blending.
- xferProcessor.reset(GrPorterDuffXPFactory::CreateSrcOverXferProcessor(
- *args.fCaps, args.fXPInputColor, args.fXPInputCoverage, hasMixedSamples));
- }
+ sk_sp<GrXferProcessor> xferProcessor =
+ GrXPFactory::MakeXferProcessor(args.fProcessors->xpFactory(), args.fXPInputColor,
+ args.fXPInputCoverage, hasMixedSamples, *args.fCaps);
fXferProcessor.reset(xferProcessor.get());
}
if (args.fDstTexture.texture()) {