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 <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
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 <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/include/private/GrOpList.h b/include/private/GrOpList.h
index 72ef07e..d795be8 100644
--- a/include/private/GrOpList.h
+++ b/include/private/GrOpList.h
@@ -113,16 +113,6 @@
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 897c473..149b112 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -72,16 +72,6 @@
}
}
-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<GrOpList> opList) {
fOpLists.emplace_back(std::move(opList));
}
@@ -219,10 +209,6 @@
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 157a6c6..3f2245e 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -118,8 +118,6 @@
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 f66fec9..66300df 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -610,21 +610,6 @@
}
}
-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 44cc39f..7faae2a 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -126,8 +126,6 @@
// 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 1b18c09..2d93f77 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -180,24 +180,6 @@
}
}
-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 839b863..133fb2d 100644
--- a/src/gpu/GrTextureOpList.h
+++ b/src/gpu/GrTextureOpList.h
@@ -59,8 +59,6 @@
SkDEBUGCODE(void dump(bool printDependencies) const override;)
private:
- bool onIsUsed(GrSurfaceProxy*) const override;
-
void deleteOp(int index);
void deleteOps();