Make Gr[Op]MemoryPool allocate itself into its initial block.
Saves one heap allocation per DDL recorded.
Change-Id: I9393aedc3b48031cd2ea5f0160b107915077099a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259419
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrRecordingContext.cpp b/src/gpu/GrRecordingContext.cpp
index aa7d1a1..cf38a21 100644
--- a/src/gpu/GrRecordingContext.cpp
+++ b/src/gpu/GrRecordingContext.cpp
@@ -122,7 +122,7 @@
// DDL TODO: should the size of the memory pool be decreased in DDL mode? CPU-side memory
// consumed in DDL mode vs. normal mode for a single skp might be a good metric of wasted
// memory.
- fOpMemoryPool = std::make_unique<GrOpMemoryPool>(16384, 16384);
+ fOpMemoryPool = GrOpMemoryPool::Make(16384, 16384);
}
return fOpMemoryPool.get();