Revert "Skip flush in GrDrawingManager if the specifed proxy doesn't have any work"

This reverts commit 4187ac5e47.

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>
This commit is contained in:
Robert Phillips 2019-04-09 12:46:18 +00:00 committed by Skia Commit-Bot
parent 097e77cd3b
commit 9a7c7be159
7 changed files with 0 additions and 63 deletions

View File

@ -113,16 +113,6 @@ protected:
private: private:
friend class GrDrawingManager; // for resetFlag, TopoSortTraits & gatherProxyIntervals 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 addDependency(GrOpList* dependedOn);
void addDependent(GrOpList* dependent); void addDependent(GrOpList* dependent);
SkDEBUGCODE(bool isDependedent(const GrOpList* dependent) const;) SkDEBUGCODE(bool isDependedent(const GrOpList* dependent) const;)

View File

@ -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<GrOpList> opList) { void GrDrawingManager::OpListDAG::add(sk_sp<GrOpList> opList) {
fOpLists.emplace_back(std::move(opList)); fOpLists.emplace_back(std::move(opList));
} }
@ -219,10 +209,6 @@ GrSemaphoresSubmitted GrDrawingManager::flush(GrSurfaceProxy* proxy,
SkDEBUGCODE(this->validate()); SkDEBUGCODE(this->validate());
if (SkSurface::kNone_FlushFlags == flags && !numSemaphores && proxy && !fDAG.isUsed(proxy)) {
return GrSemaphoresSubmitted::kNo;
}
auto direct = fContext->priv().asDirectContext(); auto direct = fContext->priv().asDirectContext();
if (!direct) { if (!direct) {
return GrSemaphoresSubmitted::kNo; // Can't flush while DDL recording return GrSemaphoresSubmitted::kNo; // Can't flush while DDL recording

View File

@ -118,8 +118,6 @@ private:
bool empty() const { return fOpLists.empty(); } bool empty() const { return fOpLists.empty(); }
int numOpLists() const { return fOpLists.count(); } int numOpLists() const { return fOpLists.count(); }
bool isUsed(GrSurfaceProxy*) const;
GrOpList* opList(int index) { return fOpLists[index].get(); } GrOpList* opList(int index) { return fOpLists[index].get(); }
const GrOpList* opList(int index) const { return fOpLists[index].get(); } const GrOpList* opList(int index) const { return fOpLists[index].get(); }

View File

@ -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 { void GrRenderTargetOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const {
for (int i = 0; i < fDeferredProxies.count(); ++i) { for (int i = 0; i < fDeferredProxies.count(); ++i) {

View File

@ -126,8 +126,6 @@ private:
// however, requires that the RTC be able to coordinate with the op list to achieve similar ends // however, requires that the RTC be able to coordinate with the op list to achieve similar ends
friend class GrRenderTargetContext; friend class GrRenderTargetContext;
bool onIsUsed(GrSurfaceProxy*) const override;
// Must only be called if native stencil buffer clearing is enabled // Must only be called if native stencil buffer clearing is enabled
void setStencilLoadOp(GrLoadOp op); void setStencilLoadOp(GrLoadOp op);
// Must only be called if native color buffer clearing is enabled. // Must only be called if native color buffer clearing is enabled.

View File

@ -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 { void GrTextureOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const {
// Add the interval for all the writes to this opList's target // Add the interval for all the writes to this opList's target

View File

@ -59,8 +59,6 @@ public:
SkDEBUGCODE(void dump(bool printDependencies) const override;) SkDEBUGCODE(void dump(bool printDependencies) const override;)
private: private:
bool onIsUsed(GrSurfaceProxy*) const override;
void deleteOp(int index); void deleteOp(int index);
void deleteOps(); void deleteOps();