Just skip uninstantiated GrOps instead of delete them on flush.
Change-Id: I4e1755872979b635ad993cfba6b17d7b79ee2c54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238179
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrOpsTask.h b/src/gpu/GrOpsTask.h
index d346f1f..b005671 100644
--- a/src/gpu/GrOpsTask.h
+++ b/src/gpu/GrOpsTask.h
@@ -165,6 +165,11 @@
const DstProxy*, const GrAppliedClip*, const GrCaps&,
GrOpMemoryPool*, GrAuditTrail*);
+ void setSkipExecuteFlag() { fSkipExecute = true; }
+ bool shouldExecute() const {
+ return SkToBool(this->head()) && !fSkipExecute;
+ }
+
private:
class List {
public:
@@ -200,6 +205,10 @@
DstProxy fDstProxy;
GrAppliedClip* fAppliedClip;
SkRect fBounds;
+
+ // We set this flag to true if any of the ops' proxies fail to instantiate so that we know
+ // not to try and draw the op.
+ bool fSkipExecute = false;
};