aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrDrawingManager.cpp11
-rw-r--r--src/gpu/GrGpu.h4
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp1
-rw-r--r--src/gpu/GrTextureOpList.cpp7
-rw-r--r--src/gpu/GrTextureOpList.h3
-rw-r--r--src/gpu/vk/GrVkGpu.cpp2
-rw-r--r--src/gpu/vk/GrVkGpu.h2
7 files changed, 11 insertions, 19 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 0dc78ecb1e..9c49ab88de 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -155,15 +155,13 @@ void GrDrawingManager::internalFlush(GrSurfaceProxy*, GrResourceCache::FlushType
if (fOpLists[i]->executeOps(&fFlushState)) {
flushed = true;
}
+ fOpLists[i]->reset();
}
+ fOpLists.reset();
SkASSERT(fFlushState.nextDrawToken() == fFlushState.nextTokenToFlush());
- for (int i = 0; i < fOpLists.count(); ++i) {
- fOpLists[i]->reset();
- }
-
- fOpLists.reset();
+ fContext->getGpu()->finishFlush();
fFlushState.reset();
// We always have to notify the cache when it requested a flush so it can reset its state.
@@ -230,8 +228,7 @@ sk_sp<GrTextureOpList> GrDrawingManager::newTextureOpList(GrTextureProxy* textur
fOpLists.back()->makeClosed(*fContext->caps());
}
- sk_sp<GrTextureOpList> opList(new GrTextureOpList(textureProxy, fContext->getGpu(),
- fContext->getAuditTrail()));
+ sk_sp<GrTextureOpList> opList(new GrTextureOpList(textureProxy, fContext->getAuditTrail()));
SkASSERT(textureProxy->getLastOpList() == opList.get());
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index f1efadb659..abaf684a1e 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -376,9 +376,9 @@ public:
const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo,
const GrGpuCommandBuffer::LoadAndStoreInfo& stencilInfo) = 0;
- // Called by GrOpList when flushing.
+ // Called by GrDrawingManager when flushing.
// Provides a hook for post-flush actions (e.g. Vulkan command buffer submits).
- virtual void finishOpList() {}
+ virtual void finishFlush() {}
virtual GrFence SK_WARN_UNUSED_RESULT insertFence() = 0;
virtual bool waitFence(GrFence, uint64_t timeout = 1000) = 0;
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 4a6590687d..fe87bdeef0 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -178,7 +178,6 @@ bool GrRenderTargetOpList::executeOps(GrOpFlushState* flushState) {
finish_command_buffer(commandBuffer.get());
flushState->setCommandBuffer(nullptr);
- flushState->gpu()->finishOpList();
return true;
}
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index 24bea3331c..dd1c8403b0 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -15,13 +15,11 @@
////////////////////////////////////////////////////////////////////////////////
-GrTextureOpList::GrTextureOpList(GrTextureProxy* proxy, GrGpu* gpu, GrAuditTrail* auditTrail)
- : INHERITED(proxy, auditTrail)
- , fGpu(SkRef(gpu)) {
+GrTextureOpList::GrTextureOpList(GrTextureProxy* proxy, GrAuditTrail* auditTrail)
+ : INHERITED(proxy, auditTrail) {
}
GrTextureOpList::~GrTextureOpList() {
- fGpu->unref();
}
////////////////////////////////////////////////////////////////////////////////
@@ -71,7 +69,6 @@ bool GrTextureOpList::executeOps(GrOpFlushState* flushState) {
fRecordedOps[i]->execute(flushState);
}
- fGpu->finishOpList();
return true;
}
diff --git a/src/gpu/GrTextureOpList.h b/src/gpu/GrTextureOpList.h
index 984762c8ae..163c05c919 100644
--- a/src/gpu/GrTextureOpList.h
+++ b/src/gpu/GrTextureOpList.h
@@ -23,7 +23,7 @@ struct SkIRect;
class GrTextureOpList final : public GrOpList {
public:
- GrTextureOpList(GrTextureProxy*, GrGpu*, GrAuditTrail*);
+ GrTextureOpList(GrTextureProxy*, GrAuditTrail*);
~GrTextureOpList() override;
@@ -74,7 +74,6 @@ private:
GrSurfaceProxy::UniqueID proxyUniqueID);
SkSTArray<2, std::unique_ptr<GrOp>, true> fRecordedOps;
- GrGpu* fGpu;
typedef GrOpList INHERITED;
};
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 107e46ae40..48e2e694fe 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1417,7 +1417,7 @@ void GrVkGpu::addImageMemoryBarrier(VkPipelineStageFlags srcStageMask,
barrier);
}
-void GrVkGpu::finishOpList() {
+void GrVkGpu::finishFlush() {
// Submit the current command buffer to the Queue
this->submitCommandBuffer(kSkip_SyncQueue);
}
diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h
index 3bedfd2ce6..9442d3f979 100644
--- a/src/gpu/vk/GrVkGpu.h
+++ b/src/gpu/vk/GrVkGpu.h
@@ -127,7 +127,7 @@ public:
GrVkRenderTarget*,
const SkIRect& bounds);
- void finishOpList() override;
+ void finishFlush() override;
GrFence SK_WARN_UNUSED_RESULT insertFence() override;
bool waitFence(GrFence, uint64_t timeout) override;