diff options
author | Brian Salomon <bsalomon@google.com> | 2017-01-11 13:42:54 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-11 19:56:48 +0000 |
commit | 82f44319159bb98dcacdbbec7ea643dde5ed024b (patch) | |
tree | dcd8c8a5caaac2675fcfdf48c5af67f946200c24 /src/gpu/GrSWMaskHelper.cpp | |
parent | ab273facbfe496a3d5dd798e6b4b57c41eed7f16 (diff) |
Make GrPaints move their GrProcessor ownership into GrPipelineBuilder.
This makes GrPaints usable only once. In some places we must make copies in order to issue draws with the same paint state.
Change-Id: Ie816e5185ce93a064111cad64c6880e1e21184c2
Reviewed-on: https://skia-review.googlesource.com/6844
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrSWMaskHelper.cpp')
-rw-r--r-- | src/gpu/GrSWMaskHelper.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index 10343a35de..839ec25d63 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -160,7 +160,7 @@ sk_sp<GrTexture> GrSWMaskHelper::DrawShapeMaskToTexture(GrContext* context, void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture, GrRenderTargetContext* renderTargetContext, - const GrPaint& paint, + GrPaint&& paint, const GrUserStencilSettings& userStencilSettings, const GrClip& clip, const SkMatrix& viewMatrix, @@ -181,16 +181,14 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture, maskMatrix.preTranslate(SkIntToScalar(-textureOriginInDeviceSpace.fX), SkIntToScalar(-textureOriginInDeviceSpace.fY)); maskMatrix.preConcat(viewMatrix); - GrPipelineBuilder pipelineBuilder(paint, GrAAType::kNone); + std::unique_ptr<GrDrawOp> op = GrRectOpFactory::MakeNonAAFill(paint.getColor(), SkMatrix::I(), + dstRect, nullptr, &invert); + GrPipelineBuilder pipelineBuilder(std::move(paint), GrAAType::kNone); pipelineBuilder.setUserStencil(&userStencilSettings); - pipelineBuilder.addCoverageFragmentProcessor( GrSimpleTextureEffect::Make(texture, nullptr, maskMatrix, GrSamplerParams::kNone_FilterMode)); - - std::unique_ptr<GrDrawOp> op = GrRectOpFactory::MakeNonAAFill(paint.getColor(), SkMatrix::I(), - dstRect, nullptr, &invert); renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op)); } |