Move ref counting out of GrProcessor and into subclasses.
This will allow different subclasses to use different models for lifetime management.
GrXferProcessor moves to simple ref counting since they don't own GrGpuResources.
This also constifies GrXferProcessor factories.
Change-Id: I6bea0ea8de718874063224232f9da50887868b16
Reviewed-on: https://skia-review.googlesource.com/11792
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp
index 9361764..a76a10b8 100644
--- a/src/gpu/GrProcessorSet.cpp
+++ b/src/gpu/GrProcessorSet.cpp
@@ -47,7 +47,7 @@
}
}
if (this->isFinalized() && this->xferProcessor()) {
- this->xferProcessor()->completedExecution();
+ this->xferProcessor()->unref();
}
}
@@ -168,12 +168,9 @@
auto xp = GrXPFactory::MakeXferProcessor(this->xpFactory(), colorAnalysis.outputColor(),
outputCoverage, isMixedSamples, caps);
- fXP.fProcessor = xp.get();
- if (fXP.fProcessor) {
- fXP.fProcessor->addPendingExecution();
- }
- fFlags |= kFinalized_Flag;
+ fXP.fProcessor = xp.release();
+ fFlags |= kFinalized_Flag;
analysis.fIsInitialized = true;
return analysis;
}