18 : fGraphicsPipelineCache(256)
19 , fComputePipelineCache(256) {}
24 SkASSERT(fGraphicsPipelineCache.count() == 0);
25 SkASSERT(fComputePipelineCache.count() == 0);
26 SkASSERT(fStaticResource.size() == 0);
32 fGraphicsPipelineCache.reset();
33 fComputePipelineCache.reset();
34 fStaticResource.clear();
41 return entry ? *entry :
nullptr;
53 entry = fGraphicsPipelineCache.insert(
key, std::move(pipeline));
58#if defined(GRAPHITE_TEST_UTILS)
59int GlobalCache::numGraphicsPipelines()
const {
62 return fGraphicsPipelineCache.count();
65void GlobalCache::resetGraphicsPipelines() {
68 fGraphicsPipelineCache.reset();
71void GlobalCache::forEachGraphicsPipeline(
72 const std::function<
void(
const UniqueKey&,
const GraphicsPipeline*)>& fn) {
84 return entry ? *entry :
nullptr;
92 entry = fComputePipelineCache.insert(
key, std::move(pipeline));
99 fStaticResource.push_back(std::move(
resource));
static SkString resource(SkPDFResourceType type, int index)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
sk_sp< ComputePipeline > addComputePipeline(const UniqueKey &, sk_sp< ComputePipeline >) SK_EXCLUDES(fSpinLock)
sk_sp< ComputePipeline > findComputePipeline(const UniqueKey &) SK_EXCLUDES(fSpinLock)
void addStaticResource(sk_sp< Resource >) SK_EXCLUDES(fSpinLock)
sk_sp< GraphicsPipeline > addGraphicsPipeline(const UniqueKey &, sk_sp< GraphicsPipeline >) SK_EXCLUDES(fSpinLock)
sk_sp< GraphicsPipeline > findGraphicsPipeline(const UniqueKey &) SK_EXCLUDES(fSpinLock)
Dart_NativeFunction function