Index: src/gpu/vk/GrVkGpu.cpp |
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp |
index c4c32d12ff644a8ee265e9a192660ea5bc42e67a..cbd233f3b1d6b07f9d74b796b5b3ff936bef560f 100644 |
--- a/src/gpu/vk/GrVkGpu.cpp |
+++ b/src/gpu/vk/GrVkGpu.cpp |
@@ -1297,12 +1297,12 @@ bool GrVkGpu::prepareDrawState(const GrPipeline& pipeline, |
const GrPrimitiveProcessor& primProc, |
GrPrimitiveType primitiveType, |
const GrVkRenderPass& renderPass, |
- GrVkPipelineState** pipelineState) { |
+ sk_sp<GrVkPipelineState>* pipelineState) { |
*pipelineState = fResourceProvider.findOrCreateCompatiblePipelineState(pipeline, |
primProc, |
primitiveType, |
renderPass); |
- if (!pipelineState) { |
+ if (!*pipelineState) { |
return false; |
} |
@@ -1329,7 +1329,7 @@ void GrVkGpu::onDraw(const GrPipeline& pipeline, |
fCurrentCmdBuffer->beginRenderPass(this, renderPass, *vkRT); |
- GrVkPipelineState* pipelineState = nullptr; |
+ sk_sp<GrVkPipelineState> pipelineState = nullptr; |
GrPrimitiveType primitiveType = meshes[0].primitiveType(); |
if (!this->prepareDrawState(pipeline, primProc, primitiveType, *renderPass, &pipelineState)) { |
return; |
@@ -1386,7 +1386,6 @@ void GrVkGpu::onDraw(const GrPipeline& pipeline, |
// pipelineState:setData but this will allow for quicker freeing of resources if the |
// pipelineState sits in a cache for a while. |
pipelineState->freeTempResources(this); |
- pipelineState->unref(); |
SkDEBUGCODE(pipelineState = nullptr); |
primitiveType = nonIdxMesh->primitiveType(); |
if (!this->prepareDrawState(pipeline, primProc, primitiveType, *renderPass, |
@@ -1422,7 +1421,6 @@ void GrVkGpu::onDraw(const GrPipeline& pipeline, |
// pipelineState:setData but this will allow for quicker freeing of resources if the |
// pipelineState sits in a cache for a while. |
pipelineState->freeTempResources(this); |
- pipelineState->unref(); |
#if SWAP_PER_DRAW |
glFlush(); |