aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetOpList.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-01-29 10:34:25 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-29 16:01:21 +0000
commitaa3dfbe51e6f14db5ccc048b4167ad334ce05176 (patch)
tree29ecae5f1461148747751d7c51e00e3cc470db9b /src/gpu/GrRenderTargetOpList.cpp
parent03bd9ee472ed1f7b3b2320277fdf32e461abc54d (diff)
Remove Ops whose lazy proxies fail to instantiate on flush
Bug: skia: Change-Id: If8b5b9e5d0c306be28ba192b731d34d185427354 Reviewed-on: https://skia-review.googlesource.com/99440 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 0c806bfe2c..ccf2b78385 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -45,7 +45,7 @@ void GrRenderTargetOpList::dump() const {
for (int i = 0; i < fRecordedOps.count(); ++i) {
SkDebugf("*******************************\n");
if (!fRecordedOps[i].fOp) {
- SkDebugf("%d: <combined forward>\n", i);
+ SkDebugf("%d: <combined forward or failed instantiation>\n", i);
} else {
SkDebugf("%d: %s\n", i, fRecordedOps[i].fOp->name());
SkString str = fRecordedOps[i].fOp->dumpInfo();
@@ -238,6 +238,23 @@ bool GrRenderTargetOpList::copySurface(const GrCaps& caps,
return true;
}
+void GrRenderTargetOpList::purgeOpsWithUninstantiatedProxies() {
+ bool hasUninstantiatedProxy = false;
+ auto checkInstantiation = [ &hasUninstantiatedProxy ] (GrSurfaceProxy* p) {
+ if (!p->priv().isInstantiated()) {
+ hasUninstantiatedProxy = true;
+ }
+ };
+ for (RecordedOp& recordedOp : fRecordedOps) {
+ hasUninstantiatedProxy = false;
+ recordedOp.visitProxies(checkInstantiation);
+ if (hasUninstantiatedProxy) {
+ // When instantiation of the proxy fails we drop the Op
+ recordedOp.fOp = nullptr;
+ }
+ }
+}
+
void GrRenderTargetOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const {
unsigned int cur = alloc->numOps();