diff options
author | Brian Salomon <bsalomon@google.com> | 2016-12-13 15:10:11 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-13 20:48:50 +0000 |
commit | 24f19780d1e76595c049d8cad4352de839cfc6b5 (patch) | |
tree | 43caf0b20dddaf2687451ae0f8096bfc639dbda2 /src/gpu/text | |
parent | d5aabd6744b64e2bfc48b4dec2311ce58e6f9225 (diff) |
Make GrRenderTargetContext::addDrawOp use sk_sp
Change-Id: Iff7f63635cdbc5cc51e5968a565f2fde2be3acb0
Reviewed-on: https://skia-review.googlesource.com/5932
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrAtlasTextBlob.cpp | 11 | ||||
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.cpp | 11 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp index 1fb4f2cdda..c5fa86f6e8 100644 --- a/src/gpu/text/GrAtlasTextBlob.cpp +++ b/src/gpu/text/GrAtlasTextBlob.cpp @@ -317,15 +317,12 @@ void GrAtlasTextBlob::flushRun(GrRenderTargetContext* rtc, const GrPaint& grPain GrColor color = grPaint.getColor(); - sk_sp<GrDrawOp> batch(this->createBatch(info, glyphCount, run, - subRun, viewMatrix, x, y, color, - skPaint, props, - distanceAdjustTable, - rtc->isGammaCorrect(), - cache)); + sk_sp<GrDrawOp> op(this->createBatch(info, glyphCount, run, subRun, viewMatrix, x, y, color, + skPaint, props, distanceAdjustTable, + rtc->isGammaCorrect(), cache)); GrPipelineBuilder pipelineBuilder(grPaint, GrAAType::kNone); - rtc->addDrawOp(pipelineBuilder, clip, batch.get()); + rtc->addDrawOp(pipelineBuilder, clip, std::move(op)); } } diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index b573b83f62..50ca192407 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -633,11 +633,10 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, const SkRect bounds = SkRect::MakeIWH(renderTargetContext->width(), renderTargetContext->height()); - sk_sp<GrDrawOp> batch( - GrDrawPathRangeBatch::Create(viewMatrix, fTextRatio, fTextInverseRatio * x, - fTextInverseRatio * y, grPaint.getColor(), - GrPathRendering::kWinding_FillType, glyphs.get(), - fInstanceData.get(), bounds)); + sk_sp<GrDrawOp> op(GrDrawPathRangeBatch::Create( + viewMatrix, fTextRatio, fTextInverseRatio * x, fTextInverseRatio * y, + grPaint.getColor(), GrPathRendering::kWinding_FillType, glyphs.get(), + fInstanceData.get(), bounds)); // The run's "font" overrides the anti-aliasing of the passed in SkPaint! GrAAType aaType = GrAAType::kNone; @@ -651,7 +650,7 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrPipelineBuilder pipelineBuilder(grPaint, aaType); pipelineBuilder.setUserStencil(&kCoverPass); - renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get()); + renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op)); } if (fFallbackTextBlob) { |