aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp6
-rw-r--r--src/gpu/GrSWMaskHelper.cpp6
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp7
-rw-r--r--src/gpu/batches/GrAAConvexPathRenderer.cpp4
-rw-r--r--src/gpu/batches/GrAADistanceFieldPathRenderer.cpp9
-rw-r--r--src/gpu/batches/GrAAHairLinePathRenderer.cpp7
-rw-r--r--src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp10
-rw-r--r--src/gpu/batches/GrDashLinePathRenderer.cpp11
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.cpp15
-rw-r--r--src/gpu/batches/GrMSAAPathRenderer.cpp15
-rw-r--r--src/gpu/batches/GrPLSPathRenderer.cpp4
-rw-r--r--src/gpu/batches/GrStencilAndCoverPathRenderer.cpp13
-rw-r--r--src/gpu/batches/GrTessellatingPathRenderer.cpp12
-rw-r--r--src/gpu/text/GrAtlasTextBlob.cpp11
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp11
15 files changed, 63 insertions, 78 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index a40473f566..1a1f6a5835 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -744,7 +744,7 @@ void GrRenderTargetContext::fillRectToRect(const GrClip& clip,
sk_sp<GrDrawOp> op(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(), viewMatrix,
croppedRect, croppedLocalRect));
GrPipelineBuilder pipelineBuilder(paint, aaType);
- this->addDrawOp(pipelineBuilder, clip, op.get());
+ this->addDrawOp(pipelineBuilder, clip, std::move(op));
return;
}
@@ -1584,11 +1584,11 @@ void GrRenderTargetContext::internalDrawPath(const GrClip& clip,
}
void GrRenderTargetContext::addDrawOp(const GrPipelineBuilder& pipelineBuilder, const GrClip& clip,
- GrDrawOp* op) {
+ sk_sp<GrDrawOp> op) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrRenderTargetContext::addDrawOp");
- this->getOpList()->addDrawOp(pipelineBuilder, this, clip, sk_ref_sp(op));
+ this->getOpList()->addDrawOp(pipelineBuilder, this, clip, std::move(op));
}
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 7351ecd547..6bbb3bdd20 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -192,7 +192,7 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
maskMatrix,
GrSamplerParams::kNone_FilterMode));
- sk_sp<GrDrawOp> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), SkMatrix::I(),
- dstRect, nullptr, &invert));
- renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
+ sk_sp<GrDrawOp> op(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), SkMatrix::I(), dstRect,
+ nullptr, &invert));
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
}
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 73080a6ba0..cb3f679730 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -68,13 +68,12 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrRenderTargetContext* renderTargetCo
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix) {
- sk_sp<GrDrawOp> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
- viewMatrix, rect,
- nullptr, &localMatrix));
+ sk_sp<GrDrawOp> op(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewMatrix, rect,
+ nullptr, &localMatrix));
GrPipelineBuilder pipelineBuilder(paint, GrAAType::kNone);
pipelineBuilder.setUserStencil(&userStencilSettings);
- renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
}
void GrSoftwarePathRenderer::DrawAroundInvPath(GrRenderTargetContext* renderTargetContext,
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp
index cc31f4973a..69b99fd7d4 100644
--- a/src/gpu/batches/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp
@@ -1000,12 +1000,12 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkPath path;
args.fShape->asPath(&path);
- sk_sp<GrDrawOp> batch(new AAConvexPathBatch(args.fPaint->getColor(), *args.fViewMatrix, path));
+ sk_sp<GrDrawOp> op(new AAConvexPathBatch(args.fPaint->getColor(), *args.fViewMatrix, path));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
return true;
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index 71b9000482..738d1c8f63 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -530,14 +530,13 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) {
}
}
- sk_sp<GrDrawOp> batch(new AADistanceFieldPathBatch(args.fPaint->getColor(),
- *args.fShape, *args.fViewMatrix,
- fAtlas.get(), &fShapeCache, &fShapeList,
- args.fGammaCorrect));
+ sk_sp<GrDrawOp> op(new AADistanceFieldPathBatch(args.fPaint->getColor(), *args.fShape,
+ *args.fViewMatrix, fAtlas.get(), &fShapeCache,
+ &fShapeList, args.fGammaCorrect));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
return true;
}
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 732d694b45..29231cdc55 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -977,13 +977,12 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
SkPath path;
args.fShape->asPath(&path);
- sk_sp<GrDrawOp> batch(create_hairline_batch(args.fPaint->getColor(),
- *args.fViewMatrix, path,
- args.fShape->style(), devClipBounds));
+ sk_sp<GrDrawOp> op(create_hairline_batch(args.fPaint->getColor(), *args.fViewMatrix, path,
+ args.fShape->style(), devClipBounds));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
return true;
}
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index cbf526c807..dc1cd8a273 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -355,16 +355,14 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkPaint::Join join = fill ? SkPaint::Join::kMiter_Join : stroke.getJoin();
SkScalar miterLimit = stroke.getMiter();
- sk_sp<GrDrawOp> batch(new AAFlatteningConvexPathBatch(args.fPaint->getColor(),
- *args.fViewMatrix,
- path, strokeWidth,
- stroke.getStyle(),
- join, miterLimit));
+ sk_sp<GrDrawOp> op(new AAFlatteningConvexPathBatch(args.fPaint->getColor(), *args.fViewMatrix,
+ path, strokeWidth, stroke.getStyle(), join,
+ miterLimit));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
return true;
}
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index 9304885c9d..1bda9d5dfe 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -45,18 +45,15 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
}
SkPoint pts[2];
SkAssertResult(args.fShape->asLine(pts, nullptr));
- sk_sp<GrDrawOp> batch(GrDashingEffect::CreateDashLineBatch(args.fPaint->getColor(),
- *args.fViewMatrix,
- pts,
- aaMode,
- args.fShape->style()));
- if (!batch) {
+ sk_sp<GrDrawOp> op(GrDashingEffect::CreateDashLineBatch(
+ args.fPaint->getColor(), *args.fViewMatrix, pts, aaMode, args.fShape->style()));
+ if (!op) {
return false;
}
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
return true;
}
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index 0b688c5305..d4f34818b8 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -564,26 +564,25 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget
}
const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
viewMatrix;
- sk_sp<GrDrawOp> batch(
- GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds, nullptr,
- &localMatrix));
+ sk_sp<GrDrawOp> op(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds,
+ nullptr, &localMatrix));
SkASSERT(GrDrawFace::kBoth == drawFace[p]);
GrPipelineBuilder pipelineBuilder(paint, aaType);
pipelineBuilder.setDrawFace(drawFace[p]);
pipelineBuilder.setUserStencil(passes[p]);
- renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
} else {
- sk_sp<GrDrawOp> batch(new DefaultPathBatch(paint.getColor(), path, srcSpaceTol,
- newCoverage, viewMatrix, isHairline,
- devBounds));
+ sk_sp<GrDrawOp> op(new DefaultPathBatch(paint.getColor(), path, srcSpaceTol,
+ newCoverage, viewMatrix, isHairline,
+ devBounds));
GrPipelineBuilder pipelineBuilder(paint, aaType);
pipelineBuilder.setDrawFace(drawFace[p]);
pipelineBuilder.setUserStencil(passes[p]);
if (passCount > 1) {
pipelineBuilder.setDisableColorXPFactory();
}
- renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
}
}
return true;
diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
index 930f7f926a..84017d63ef 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -659,18 +659,17 @@ bool GrMSAAPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetCon
}
const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
viewMatrix;
- sk_sp<GrDrawOp> batch(
- GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds, nullptr,
- &localMatrix));
+ sk_sp<GrDrawOp> op(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds,
+ nullptr, &localMatrix));
GrPipelineBuilder pipelineBuilder(paint, aaType);
pipelineBuilder.setUserStencil(passes[p]);
- renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
} else {
- sk_sp<MSAAPathBatch> batch(new MSAAPathBatch(paint.getColor(), path,
- viewMatrix, devBounds));
- if (!batch->isValid()) {
+ sk_sp<MSAAPathBatch> op(
+ new MSAAPathBatch(paint.getColor(), path, viewMatrix, devBounds));
+ if (!op->isValid()) {
return false;
}
@@ -679,7 +678,7 @@ bool GrMSAAPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetCon
if (passCount > 1) {
pipelineBuilder.setDisableColorXPFactory();
}
- renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
}
}
return true;
diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp
index 269fde166c..ae6485f1e0 100644
--- a/src/gpu/batches/GrPLSPathRenderer.cpp
+++ b/src/gpu/batches/GrPLSPathRenderer.cpp
@@ -935,11 +935,11 @@ bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkPath path;
args.fShape->asPath(&path);
- sk_sp<GrDrawOp> batch(new PLSPathBatch(args.fPaint->getColor(), path, *args.fViewMatrix));
+ sk_sp<GrDrawOp> op(new PLSPathBatch(args.fPaint->getColor(), path, *args.fViewMatrix));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
SkDEBUGCODE(inPLSDraw = false;)
return true;
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index ac9ed9035e..a4318b741a 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -113,9 +113,8 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
}
const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : viewMatrix;
- sk_sp<GrDrawOp> coverBatch(
- GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds,
- nullptr, &invert));
+ sk_sp<GrDrawOp> coverOp(GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM,
+ bounds, nullptr, &invert));
// fake inverse with a stencil and cover
args.fRenderTargetContext->priv().stencilPath(*args.fClip, args.fAAType, viewMatrix,
@@ -143,7 +142,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
GrPipelineBuilder pipelineBuilder(*args.fPaint, coverAAType);
pipelineBuilder.setUserStencil(&kInvertedCoverPass);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, coverBatch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(coverOp));
}
} else {
static constexpr GrUserStencilSettings kCoverPass(
@@ -156,12 +155,12 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
0xffff>()
);
- sk_sp<GrDrawOp> batch(GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(),
- path.get()));
+ sk_sp<GrDrawOp> op(
+ GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), path.get()));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(&kCoverPass);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
}
return true;
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp
index 4b3ef00193..f2616e414a 100644
--- a/src/gpu/batches/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp
@@ -360,14 +360,14 @@ bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
args.fClip->getConservativeBounds(args.fRenderTargetContext->width(),
args.fRenderTargetContext->height(),
&clipBoundsI);
- sk_sp<GrDrawOp> batch(TessellatingPathBatch::Create(args.fPaint->getColor(),
- *args.fShape,
- *args.fViewMatrix,
- clipBoundsI,
- GrAAType::kCoverage == args.fAAType));
+ sk_sp<GrDrawOp> op(TessellatingPathBatch::Create(args.fPaint->getColor(),
+ *args.fShape,
+ *args.fViewMatrix,
+ clipBoundsI,
+ GrAAType::kCoverage == args.fAAType));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());
+ args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, std::move(op));
return true;
}
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) {