diff options
author | 2017-01-03 09:42:58 -0500 | |
---|---|---|
committer | 2017-01-03 15:22:16 +0000 | |
commit | f8334781914363caf537f22f012fcd5c03c60dad (patch) | |
tree | cfa54aa4a80cd7841959300c245d633fbcd382a0 /src/gpu/GrRenderTargetOpList.cpp | |
parent | 5f500920e719b215d5e0e36a6679995ed3c9b4ad (diff) |
Remove ref counting from GrOp.
Instead use std::unique_ptr to manage GrOp lifetime.
Change-Id: Ic1dc1e0ffd7254c3994221f498677af5bbf66a71
Reviewed-on: https://skia-review.googlesource.com/6479
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetOpList.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp index 0e74ad1b79..9fb2dcbd1c 100644 --- a/src/gpu/GrRenderTargetOpList.cpp +++ b/src/gpu/GrRenderTargetOpList.cpp @@ -264,7 +264,8 @@ static void op_bounds(SkRect* bounds, const GrOp* op) { void GrRenderTargetOpList::addDrawOp(const GrPipelineBuilder& pipelineBuilder, GrRenderTargetContext* renderTargetContext, const GrClip& clip, - sk_sp<GrDrawOp> op) { + std::unique_ptr<GrDrawOp> + op) { // Setup clip SkRect bounds; op_bounds(&bounds, op.get()); @@ -384,14 +385,14 @@ void GrRenderTargetOpList::stencilPath(GrRenderTargetContext* renderTargetContex return; } - sk_sp<GrOp> op = GrStencilPathOp::Make(viewMatrix, - useHWAA, - path->getFillType(), - appliedClip.hasStencilClip(), - stencilAttachment->bits(), - appliedClip.scissorState(), - renderTargetContext->accessRenderTarget(), - path); + std::unique_ptr<GrOp> op = GrStencilPathOp::Make(viewMatrix, + useHWAA, + path->getFillType(), + appliedClip.hasStencilClip(), + stencilAttachment->bits(), + appliedClip.scissorState(), + renderTargetContext->accessRenderTarget(), + path); this->recordOp(std::move(op), renderTargetContext, appliedClip.clippedDrawBounds()); } @@ -408,7 +409,7 @@ void GrRenderTargetOpList::fullClear(GrRenderTargetContext* renderTargetContext, fLastFullClearOp->setColor(color); return; } - sk_sp<GrClearOp> op(GrClearOp::Make(GrFixedClip::Disabled(), color, renderTarget)); + std::unique_ptr<GrClearOp> op(GrClearOp::Make(GrFixedClip::Disabled(), color, renderTarget)); if (GrOp* clearOp = this->recordOp(std::move(op), renderTargetContext)) { // This is either the clear op we just created or another one that it combined with. fLastFullClearOp = static_cast<GrClearOp*>(clearOp); @@ -431,7 +432,7 @@ bool GrRenderTargetOpList::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint) { - sk_sp<GrOp> op = GrCopySurfaceOp::Make(dst, src, srcRect, dstPoint); + std::unique_ptr<GrOp> op = GrCopySurfaceOp::Make(dst, src, srcRect, dstPoint); if (!op) { return false; } @@ -460,7 +461,8 @@ static void join(SkRect* out, const SkRect& a, const SkRect& b) { out->fBottom = SkTMax(a.fBottom, b.fBottom); } -GrOp* GrRenderTargetOpList::recordOp(sk_sp<GrOp> op, GrRenderTargetContext* renderTargetContext, +GrOp* GrRenderTargetOpList::recordOp(std::unique_ptr<GrOp> op, + GrRenderTargetContext* renderTargetContext, const SkRect& clippedBounds) { // TODO: Should be proxy ID. GrGpuResource::UniqueID renderTargetID = |