aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-07-24 16:09:40 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-24 16:09:46 +0000
commit6a4e60bb8f49e4a031e8fc99c4d8edaa25b3619f (patch)
tree7bd381aa01a0976fc78b7e9a8b54739580363f00
parentb95d278e7c2f72d42cd0626471b8f36587a47c3c (diff)
Revert "Reduce arbitrary opList splitting when sorting (take 2)"
This reverts commit 20d4e546d8cb34f8944ef00d249416a047c95524. Reason for revert: Android dying on Nexus7 & Nexus Player Original change's description: > Reduce arbitrary opList splitting when sorting (take 2) > > The original CL (https://skia-review.googlesource.com/c/skia/+/141243 (Reduce arbitrary opList splitting when sorting)) was reverted due to Gold image diffs and perf regressions on Android. > > The image diffs should be fixed by: > https://skia-review.googlesource.com/c/skia/+/142163 (Fix explicit allocation bug) > > Change-Id: I4bcc59820daf440de81f48e8970b47a6c8ec2bbb > Reviewed-on: https://skia-review.googlesource.com/142102 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com Change-Id: Ice7ed703a17a1e1fef949446538c8da7524dc42e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/143121 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
-rw-r--r--include/private/GrOpList.h7
-rw-r--r--src/gpu/GrDrawingManager.cpp42
-rw-r--r--src/gpu/GrOpList.cpp41
-rw-r--r--src/gpu/GrRenderTargetOpList.h3
4 files changed, 10 insertions, 83 deletions
diff --git a/include/private/GrOpList.h b/include/private/GrOpList.h
index a4e541c81d..9241cd78f5 100644
--- a/include/private/GrOpList.h
+++ b/include/private/GrOpList.h
@@ -113,11 +113,6 @@ private:
friend class GrDrawingManager; // for resetFlag, TopoSortTraits & gatherProxyIntervals
void addDependency(GrOpList* dependedOn);
- void addDependent(GrOpList* dependent);
- SkDEBUGCODE(bool isDependedent(const GrOpList* dependent) const);
- SkDEBUGCODE(void validate() const);
-
- void closeThoseWhoDependOnMe(const GrCaps&);
// Remove all Ops which reference proxies that have not been instantiated.
virtual void purgeOpsWithUninstantiatedProxies() = 0;
@@ -178,8 +173,6 @@ private:
// 'this' GrOpList relies on the output of the GrOpLists in 'fDependencies'
SkSTArray<1, GrOpList*, true> fDependencies;
- // 'this' GrOpList's output is relied on by the GrOpLists in 'fDependents'
- SkSTArray<1, GrOpList*, true> fDependents;
typedef SkRefCnt INHERITED;
};
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 366f285cf3..8b0fb22f6b 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -427,22 +427,11 @@ sk_sp<GrRenderTargetOpList> GrDrawingManager::newRTOpList(GrRenderTargetProxy* r
SkASSERT(fContext);
if (!fOpLists.empty()) {
- if (fSortRenderTargets) {
- // In this case we need to close all the opLists that rely on the current contents of
- // 'rtp'. That is bc we're going to update the content of the proxy so they need to be
- // split in case they use both the old and new content. (This is a bit of an overkill:
- // they really only need to be split if they ever reference proxy's contents again but
- // that is hard to predict/handle).
- if (GrOpList* lastOpList = rtp->getLastOpList()) {
- lastOpList->closeThoseWhoDependOnMe(*fContext->contextPriv().caps());
- }
- } else {
- // This is a temporary fix for the partial-MDB world. In that world we're not
- // reordering so ops that (in the single opList world) would've just glommed onto the
- // end of the single opList but referred to a far earlier RT need to appear in their
- // own opList.
- fOpLists.back()->makeClosed(*fContext->contextPriv().caps());
- }
+ // This is a temporary fix for the partial-MDB world. In that world we're not
+ // reordering so ops that (in the single opList world) would've just glommed onto the
+ // end of the single opList but referred to a far earlier RT need to appear in their
+ // own opList.
+ fOpLists.back()->makeClosed(*fContext->contextPriv().caps());
}
auto resourceProvider = fContext->contextPriv().resourceProvider();
@@ -465,22 +454,11 @@ sk_sp<GrTextureOpList> GrDrawingManager::newTextureOpList(GrTextureProxy* textur
SkASSERT(fContext);
if (!fOpLists.empty()) {
- if (fSortRenderTargets) {
- // In this case we need to close all the opLists that rely on the current contents of
- // 'rtp'. That is bc we're going to update the content of the proxy so they need to be
- // split in case they use both the old and new content. (This is a bit of an overkill:
- // they really only need to be split if they ever reference proxy's contents again but
- // that is hard to predict/handle).
- if (GrOpList* lastOpList = textureProxy->getLastOpList()) {
- lastOpList->closeThoseWhoDependOnMe(*fContext->contextPriv().caps());
- }
- } else {
- // This is a temporary fix for the partial-MDB world. In that world we're not
- // reordering so ops that (in the single opList world) would've just glommed onto the
- // end of the single opList but referred to a far earlier RT need to appear in their
- // own opList.
- fOpLists.back()->makeClosed(*fContext->contextPriv().caps());
- }
+ // This is a temporary fix for the partial-MDB world. In that world we're not
+ // reordering so ops that (in the single opList world) would've just glommed onto the
+ // end of the single opList but referred to a far earlier RT need to appear in their
+ // own opList.
+ fOpLists.back()->makeClosed(*fContext->contextPriv().caps());
}
sk_sp<GrTextureOpList> opList(new GrTextureOpList(fContext->contextPriv().resourceProvider(),
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp
index 12d15afe6a..313c38f14c 100644
--- a/src/gpu/GrOpList.cpp
+++ b/src/gpu/GrOpList.cpp
@@ -96,9 +96,6 @@ void GrOpList::addDependency(GrOpList* dependedOn) {
}
fDependencies.push_back(dependedOn);
- dependedOn->addDependent(this);
-
- SkDEBUGCODE(this->validate());
}
// Convert from a GrSurface-based dependency to a GrOpList one
@@ -137,38 +134,6 @@ bool GrOpList::dependsOn(const GrOpList* dependedOn) const {
return false;
}
-void GrOpList::addDependent(GrOpList* dependent) {
- fDependents.push_back(dependent);
-}
-
-#ifdef SK_DEBUG
-bool GrOpList::isDependedent(const GrOpList* dependent) const {
- for (int i = 0; i < fDependents.count(); ++i) {
- if (fDependents[i] == dependent) {
- return true;
- }
- }
-
- return false;
-}
-
-void GrOpList::validate() const {
- // TODO: check for loops and duplicates
-
- for (int i = 0; i < fDependencies.count(); ++i) {
- SkASSERT(fDependencies[i]->isDependedent(this));
- }
-}
-#endif
-
-void GrOpList::closeThoseWhoDependOnMe(const GrCaps& caps) {
- for (int i = 0; i < fDependents.count(); ++i) {
- if (!fDependents[i]->isClosed()) {
- fDependents[i]->makeClosed(caps);
- }
- }
-}
-
bool GrOpList::isInstantiated() const {
return fTarget.get()->priv().isInstantiated();
}
@@ -193,12 +158,6 @@ void GrOpList::dump(bool printDependencies) const {
SkDebugf("%d, ", fDependencies[i]->fUniqueID);
}
SkDebugf("\n");
-
- SkDebugf("(%d) Rely On Me: ", fDependents.count());
- for (int i = 0; i < fDependents.count(); ++i) {
- SkDebugf("%d, ", fDependents[i]->fUniqueID);
- }
- SkDebugf("\n");
}
}
#endif
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 81bd6f16e4..8629a7cb1f 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -87,9 +87,6 @@ public:
op->visitProxies(addDependency);
clip.visitProxies(addDependency);
- if (dstProxy.proxy()) {
- addDependency(dstProxy.proxy());
- }
return this->recordOp(std::move(op), caps, clip.doesClip() ? &clip : nullptr, &dstProxy);
}