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

Method removeResource

src/gpu/ResourceCache.cpp:258–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void ResourceCache::removeResource(Resource* resource) {
259 if (!resource->uniqueKey.empty()) {
260 removeUniqueKey(resource);
261 }
262 if (!resource->scratchKey.empty()) {
263 auto result = scratchKeyMap.find(resource->scratchKey);
264 if (result != scratchKeyMap.end()) {
265 auto& list = result->second;
266 list.erase(std::remove(list.begin(), list.end(), resource), list.end());
267 if (list.empty()) {
268 scratchKeyMap.erase(resource->scratchKey);
269 }
270 }
271 }
272 totalBytes -= resource->memoryUsage();
273 resource->release(true);
274}
275} // namespace tgfx

Callers

nothing calls this directly

Calls 6

emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
memoryUsageMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected