Rename opPODAllocator to recordTimeAllocator

Hopefully this is a better name. "POD" is no longer accurate since we are storing GrPipeline's in this arena.

Bug: skia:9455
Change-Id: I610267633088b0af4f0cbb36f479bf5eb6c6d0cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254992
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2019-11-15 17:28:37 -05:00 committed by Skia Commit-Bot
parent cc1d4e6ae0
commit d4fb7c7b14
7 changed files with 21 additions and 19 deletions

View File

@ -160,7 +160,7 @@ private:
const GrAppliedClip*) final {
// We're going to create the GrProgramInfo (and the GrPipeline it relies on) in the
// DDL-record-time arena.
SkArenaAlloc* arena = context->priv().opPODAllocator();
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
// Not POD! It has some sk_sp's buried inside it!
GrPipeline* pipeline = arena->make<GrPipeline>(GrScissorTest::kDisabled, SkBlendMode::kPlus,

View File

@ -50,10 +50,10 @@ protected:
sk_sp<GrOpMemoryPool> refOpMemoryPool();
GrOpMemoryPool* opMemoryPool();
SkArenaAlloc* opPODAllocator();
// This entry point should only be used for DDL creation where we want the ops' POD lifetime
SkArenaAlloc* recordTimeAllocator();
// This entry point should only be used for DDL creation where we want the ops' data's lifetime
// to match that of the DDL.
std::unique_ptr<SkArenaAlloc> detachOpPOD();
std::unique_ptr<SkArenaAlloc> detachRecordTimeAllocator();
GrStrikeCache* getGrStrikeCache() { return fStrikeCache.get(); }
GrTextBlobCache* getTextBlobCache();
@ -131,7 +131,7 @@ private:
std::unique_ptr<GrDrawingManager> fDrawingManager;
// All the GrOp-derived classes use this pool.
sk_sp<GrOpMemoryPool> fOpMemoryPool;
std::unique_ptr<SkArenaAlloc> fOpPODAllocator;
std::unique_ptr<SkArenaAlloc> fRecordTimeAllocator;
std::unique_ptr<GrStrikeCache> fStrikeCache;
std::unique_ptr<GrTextBlobCache> fTextBlobCache;

View File

@ -71,7 +71,7 @@ private:
SkTArray<sk_sp<GrRenderTask>> fRenderTasks;
PendingPathsMap fPendingPaths; // This is the path data from CCPR.
std::unique_ptr<SkArenaAlloc> fOpPOD;
std::unique_ptr<SkArenaAlloc> fRecordTimeData;
#endif
sk_sp<LazyProxyData> fLazyProxyData;
};

View File

@ -581,7 +581,7 @@ void GrDrawingManager::moveRenderTasksToDDL(SkDeferredDisplayList* ddl) {
renderTask->prePrepare(fContext);
}
ddl->fOpPOD = fContext->priv().detachOpPOD();
ddl->fRecordTimeData = fContext->priv().detachRecordTimeAllocator();
if (fPathRendererChain) {
if (auto ccpr = fPathRendererChain->getCoverageCountingPathRenderer()) {

View File

@ -137,18 +137,20 @@ GrOpMemoryPool* GrRecordingContext::opMemoryPool() {
// Stored in this arena:
// GrTextureOp's DynamicStateArrays and FixedDynamicState
SkArenaAlloc* GrRecordingContext::opPODAllocator() {
if (!fOpPODAllocator) {
// some GrGeometryProcessors, GrPipelines and GrProgramInfos
SkArenaAlloc* GrRecordingContext::recordTimeAllocator() {
if (!fRecordTimeAllocator) {
// TODO: empirically determine a better number for SkArenaAlloc's firstHeapAllocation param
fOpPODAllocator = std::unique_ptr<SkArenaAlloc>(new SkArenaAlloc(sizeof(GrPipeline) * 100));
fRecordTimeAllocator = std::unique_ptr<SkArenaAlloc>(
new SkArenaAlloc(sizeof(GrPipeline) * 100));
}
SkASSERT(fOpPODAllocator);
return fOpPODAllocator.get();
SkASSERT(fRecordTimeAllocator);
return fRecordTimeAllocator.get();
}
std::unique_ptr<SkArenaAlloc> GrRecordingContext::detachOpPOD() {
return std::move(fOpPODAllocator);
std::unique_ptr<SkArenaAlloc> GrRecordingContext::detachRecordTimeAllocator() {
return std::move(fRecordTimeAllocator);
}
GrTextBlobCache* GrRecordingContext::getTextBlobCache() {
@ -322,8 +324,8 @@ sk_sp<const GrCaps> GrRecordingContextPriv::refCaps() const {
return fContext->refCaps();
}
std::unique_ptr<SkArenaAlloc> GrRecordingContextPriv::detachOpPOD() {
return fContext->detachOpPOD();
std::unique_ptr<SkArenaAlloc> GrRecordingContextPriv::detachRecordTimeAllocator() {
return fContext->detachRecordTimeAllocator();
}
sk_sp<GrSkSLFPFactoryCache> GrRecordingContextPriv::fpFactoryCache() {

View File

@ -46,8 +46,8 @@ public:
sk_sp<GrOpMemoryPool> refOpMemoryPool();
GrOpMemoryPool* opMemoryPool() { return fContext->opMemoryPool(); }
SkArenaAlloc* opPODAllocator() { return fContext->opPODAllocator(); }
std::unique_ptr<SkArenaAlloc> detachOpPOD();
SkArenaAlloc* recordTimeAllocator() { return fContext->recordTimeAllocator(); }
std::unique_ptr<SkArenaAlloc> detachRecordTimeAllocator();
GrStrikeCache* getGrStrikeCache() { return fContext->getGrStrikeCache(); }
GrTextBlobCache* getTextBlobCache() { return fContext->getTextBlobCache(); }

View File

@ -523,7 +523,7 @@ private:
SkDEBUGCODE(this->validate();)
SkASSERT(!fPrePreparedDesc);
SkArenaAlloc* arena = context->priv().opPODAllocator();
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
fPrePreparedDesc = arena->make<PrePreparedDesc>();