diff options
author | Robert Phillips <robertphillips@google.com> | 2018-07-18 13:52:40 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-18 18:22:01 +0000 |
commit | ce3c28f1022fdb2fa93e750c9de7980d57e49731 (patch) | |
tree | 97f9b2a6d6f10b91dbb80105c79fdbeaad1a0fb8 /src/gpu/GrOpList.cpp | |
parent | 760dbc4b53499f891a9e2057524956f8381535e3 (diff) |
Pull non-substantive changes out of "Reduce arbitrary opList splitting when sorting"
Change-Id: I044d7cde5ed4f1dc60bb55dfd534680b4cd055bf
Reviewed-on: https://skia-review.googlesource.com/142167
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrOpList.cpp')
-rw-r--r-- | src/gpu/GrOpList.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp index b9f425576e..313c38f14c 100644 --- a/src/gpu/GrOpList.cpp +++ b/src/gpu/GrOpList.cpp @@ -106,11 +106,13 @@ void GrOpList::addDependency(GrSurfaceProxy* dependedOn, const GrCaps& caps) { GrOpList* opList = dependedOn->getLastOpList(); if (opList == this) { - // self-read - presumably for dst reads + // self-read - presumably for dst reads. We can't make it closed in the self-read case. } else { this->addDependency(opList); - // Can't make it closed in the self-read case + // We are closing 'opList' here bc the current contents of it are what 'this' opList + // depends on. We need a break in 'opList' so that the usage of that state has a + // chance to execute. opList->makeClosed(caps); } } @@ -122,18 +124,36 @@ void GrOpList::addDependency(GrSurfaceProxy* dependedOn, const GrCaps& caps) { } } +bool GrOpList::dependsOn(const GrOpList* dependedOn) const { + for (int i = 0; i < fDependencies.count(); ++i) { + if (fDependencies[i] == dependedOn) { + return true; + } + } + + return false; +} + bool GrOpList::isInstantiated() const { return fTarget.get()->priv().isInstantiated(); } #ifdef SK_DEBUG +static const char* op_to_name(GrLoadOp op) { + return GrLoadOp::kLoad == op ? "load" : GrLoadOp::kClear == op ? "clear" : "discard"; +} + void GrOpList::dump(bool printDependencies) const { SkDebugf("--------------------------------------------------------------\n"); - SkDebugf("opList: %d -> RT: %d\n", fUniqueID, fTarget.get() ? fTarget.get()->uniqueID().asUInt() - : -1); + SkDebugf("opListID: %d -> proxyID: %d\n", fUniqueID, + fTarget.get() ? fTarget.get()->uniqueID().asUInt() : -1); + SkDebugf("ColorLoadOp: %s %x StencilLoadOp: %s\n", + op_to_name(fColorLoadOp), + GrLoadOp::kClear == fColorLoadOp ? fLoadClearColor : 0x0, + op_to_name(fStencilLoadOp)); if (printDependencies) { - SkDebugf("relies On (%d): ", fDependencies.count()); + SkDebugf("I rely On (%d): ", fDependencies.count()); for (int i = 0; i < fDependencies.count(); ++i) { SkDebugf("%d, ", fDependencies[i]->fUniqueID); } |