From 9a7c7be15969e1e0bad0b7a5c6bb40e254265838 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 9 Apr 2019 12:46:18 +0000 Subject: [PATCH] Revert "Skip flush in GrDrawingManager if the specifed proxy doesn't have any work" This reverts commit 4187ac5e4717b08a2f302baa1697ec91bddc6ab6. Reason for revert: test if this is causing the angle GM image diffs Original change's description: > Skip flush in GrDrawingManager if the specifed proxy doesn't have any work > > This is rather ham-fisted but I would like to have a short-term fix for the "always-flush" perf regressions. > > Change-Id: Id359ad5a01a290e7e6c06f7ccc1c385ad47d2c06 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206277 > Reviewed-by: Brian Salomon > Commit-Queue: Robert Phillips TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I19ea23a6b8e3985353fc1ebaf974513bb922e9f2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206694 Reviewed-by: Robert Phillips Commit-Queue: Robert Phillips --- include/private/GrOpList.h | 10 ---------- src/gpu/GrDrawingManager.cpp | 14 -------------- src/gpu/GrDrawingManager.h | 2 -- src/gpu/GrRenderTargetOpList.cpp | 15 --------------- src/gpu/GrRenderTargetOpList.h | 2 -- src/gpu/GrTextureOpList.cpp | 18 ------------------ src/gpu/GrTextureOpList.h | 2 -- 7 files changed, 63 deletions(-) diff --git a/include/private/GrOpList.h b/include/private/GrOpList.h index 72ef07e6d9..d795be8b9c 100644 --- a/include/private/GrOpList.h +++ b/include/private/GrOpList.h @@ -113,16 +113,6 @@ protected: private: friend class GrDrawingManager; // for resetFlag, TopoSortTraits & gatherProxyIntervals - virtual bool onIsUsed(GrSurfaceProxy*) const = 0; - - bool isUsed(GrSurfaceProxy* proxy) const { - if (proxy == fTarget.get()) { - return true; - } - - return this->onIsUsed(proxy); - } - void addDependency(GrOpList* dependedOn); void addDependent(GrOpList* dependent); SkDEBUGCODE(bool isDependedent(const GrOpList* dependent) const;) diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index 897c473f89..149b112f91 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -72,16 +72,6 @@ void GrDrawingManager::OpListDAG::removeOpLists(int startIndex, int stopIndex) { } } -bool GrDrawingManager::OpListDAG::isUsed(GrSurfaceProxy* proxy) const { - for (int i = 0; i < fOpLists.count(); ++i) { - if (fOpLists[i] && fOpLists[i]->isUsed(proxy)) { - return true; - } - } - - return false; -} - void GrDrawingManager::OpListDAG::add(sk_sp opList) { fOpLists.emplace_back(std::move(opList)); } @@ -219,10 +209,6 @@ GrSemaphoresSubmitted GrDrawingManager::flush(GrSurfaceProxy* proxy, SkDEBUGCODE(this->validate()); - if (SkSurface::kNone_FlushFlags == flags && !numSemaphores && proxy && !fDAG.isUsed(proxy)) { - return GrSemaphoresSubmitted::kNo; - } - auto direct = fContext->priv().asDirectContext(); if (!direct) { return GrSemaphoresSubmitted::kNo; // Can't flush while DDL recording diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h index 157a6c6a43..3f2245e241 100644 --- a/src/gpu/GrDrawingManager.h +++ b/src/gpu/GrDrawingManager.h @@ -118,8 +118,6 @@ private: bool empty() const { return fOpLists.empty(); } int numOpLists() const { return fOpLists.count(); } - bool isUsed(GrSurfaceProxy*) const; - GrOpList* opList(int index) { return fOpLists[index].get(); } const GrOpList* opList(int index) const { return fOpLists[index].get(); } diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp index f66fec99a4..66300df8d9 100644 --- a/src/gpu/GrRenderTargetOpList.cpp +++ b/src/gpu/GrRenderTargetOpList.cpp @@ -610,21 +610,6 @@ void GrRenderTargetOpList::purgeOpsWithUninstantiatedProxies() { } } -bool GrRenderTargetOpList::onIsUsed(GrSurfaceProxy* proxyToCheck) const { - bool used = false; - - auto visit = [ proxyToCheck, &used ] (GrSurfaceProxy* p) { - if (p == proxyToCheck) { - used = true; - } - }; - for (const OpChain& recordedOp : fOpChains) { - recordedOp.visitProxies(visit, GrOp::VisitorType::kOther); - } - - return used; -} - void GrRenderTargetOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const { for (int i = 0; i < fDeferredProxies.count(); ++i) { diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h index 44cc39fd9e..7faae2ad01 100644 --- a/src/gpu/GrRenderTargetOpList.h +++ b/src/gpu/GrRenderTargetOpList.h @@ -126,8 +126,6 @@ private: // however, requires that the RTC be able to coordinate with the op list to achieve similar ends friend class GrRenderTargetContext; - bool onIsUsed(GrSurfaceProxy*) const override; - // Must only be called if native stencil buffer clearing is enabled void setStencilLoadOp(GrLoadOp op); // Must only be called if native color buffer clearing is enabled. diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp index 1b18c0902b..2d93f77b0a 100644 --- a/src/gpu/GrTextureOpList.cpp +++ b/src/gpu/GrTextureOpList.cpp @@ -180,24 +180,6 @@ void GrTextureOpList::purgeOpsWithUninstantiatedProxies() { } } -bool GrTextureOpList::onIsUsed(GrSurfaceProxy* proxyToCheck) const { - bool used = false; - - auto visit = [ proxyToCheck, &used ] (GrSurfaceProxy* p) { - if (p == proxyToCheck) { - used = true; - } - }; - for (int i = 0; i < fRecordedOps.count(); ++i) { - const GrOp* op = fRecordedOps[i].get(); - if (op) { - op->visitProxies(visit, GrOp::VisitorType::kOther); - } - } - - return used; -} - void GrTextureOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const { // Add the interval for all the writes to this opList's target diff --git a/src/gpu/GrTextureOpList.h b/src/gpu/GrTextureOpList.h index 839b8635d7..133fb2ddb9 100644 --- a/src/gpu/GrTextureOpList.h +++ b/src/gpu/GrTextureOpList.h @@ -59,8 +59,6 @@ public: SkDEBUGCODE(void dump(bool printDependencies) const override;) private: - bool onIsUsed(GrSurfaceProxy*) const override; - void deleteOp(int index); void deleteOps();