31GrGLGpu::ProgramCache::ProgramCache(
int runtimeProgramCacheSize)
32 : fMap(runtimeProgramCacheSize) {
35GrGLGpu::ProgramCache::~ProgramCache() {}
37void GrGLGpu::ProgramCache::abandon() {
40 (*e)->fProgram->abandon();
56 if (!
desc.isValid()) {
90 *stat = Stats::ProgramCacheResult::kHit;
91 std::unique_ptr<Entry>* entry = fMap.find(
desc);
92 if (entry && !(*entry)->fProgram) {
98 if (!(*entry)->fProgram) {
100 SkDEBUGFAIL(
"Couldn't create program from precompiled program");
105 *stat = Stats::ProgramCacheResult::kPartial;
114 entry = fMap.insert(
desc, std::make_unique<Entry>(std::move(program)));
115 *stat = Stats::ProgramCacheResult::kMiss;
118 return (*entry)->fProgram;
129 std::unique_ptr<Entry>* entry = fMap.find(
desc);
140 fMap.insert(
desc, std::make_unique<Entry>(precompiledProgram));
#define GrCapsDebugf(caps,...)
#define SkDEBUGFAIL(message)
const GrCaps * caps() const
virtual GrProgramDesc makeDesc(GrRenderTarget *, const GrProgramInfo &, ProgramDescOverrideFlags overrideFlags=ProgramDescOverrideFlags::kNone) const =0
GrDirectContextPriv priv()
static bool PrecompileProgram(GrDirectContext *, GrGLPrecompiledProgram *, const SkData &)
static sk_sp< GrGLProgram > CreateProgram(GrDirectContext *, const GrProgramDesc &, const GrProgramInfo &, const GrGLPrecompiledProgram *=nullptr)
const GrCaps * caps() const
static bool BuildFromData(GrProgramDesc *desc, const void *keyData, size_t keyLength)
void incNumPreCompilationFailures()
void incNumPreProgramCacheResult(ProgramCacheResult stat)
void incNumInlineCompilationFailures()
void incNumPartialCompilationSuccesses()
void incNumCompilationFailures()
void incNumInlineProgramCacheResult(ProgramCacheResult stat)
void incNumCompilationSuccesses()
sk_sp< GrGLProgram > fProgram
GrGLPrecompiledProgram fPrecompiledProgram
Entry(sk_sp< GrGLProgram > program)
Entry(const GrGLPrecompiledProgram &precompiledProgram)
std::shared_ptr< const fml::Mapping > data