MCPcopy Create free account
hub / github.com/Tencent/tgfx / findProgram

Method findProgram

src/gpu/GlobalCache.cpp:36–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36std::shared_ptr<Program> GlobalCache::findProgram(const BytesKey& programKey) {
37 auto result = programMap.find(programKey);
38 if (result != programMap.end()) {
39 auto program = result->second;
40 programLRU.erase(program->cachedPosition);
41 programLRU.push_front(program.get());
42 program->cachedPosition = programLRU.begin();
43 return program;
44 }
45 return nullptr;
46}
47
48void GlobalCache::addProgram(const BytesKey& programKey, std::shared_ptr<Program> program) {
49 if (program == nullptr) {

Callers 2

getProgramMethod · 0.80
executeMethod · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
getMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected