20 #ifndef MIR_GL_RECENTLY_USED_CACHE_H_
21 #define MIR_GL_RECENTLY_USED_CACHE_H_
27 #include <unordered_map>
45 : texture(std::make_shared<Texture>())
47 std::shared_ptr<Texture> texture;
50 bool valid_binding{
false};
51 std::shared_ptr<graphics::Buffer> resource;
54 std::unordered_map<graphics::Renderable::ID, Entry> textures;
All things Mir.
Definition: atomic_callback.h:25
Definition: texture_cache.h:31
Definition: recently_used_cache.h:34
Definition: renderable.h:33
std::shared_ptr< Texture > load(graphics::Renderable const &renderable) override
Loads texture from the renderable.
Definition: recently_used_cache.cpp:31
void drop_unused() override
Free textures that were not used (loaded) since the last drop/invalidate.
Definition: recently_used_cache.cpp:62
void invalidate() override
Mark all entries in the cache as out-of-date to ensure fresh textures are loaded next time...
Definition: recently_used_cache.cpp:56