add pull request panel
This commit is contained in:
@@ -1,23 +1,3 @@
|
||||
//! The shared image cache used by every `img` element in the app.
|
||||
//!
|
||||
//! Without an explicit cache, images (the profile pictures shown by
|
||||
//! `Avatar`s) fall back to the window's asset cache and are retained for the
|
||||
//! lifetime of the window: every avatar that was ever shown stays decoded in
|
||||
//! memory. This module installs one bounded LRU cache that the app controls
|
||||
//! instead:
|
||||
//!
|
||||
//! * The cache holds at most [`MAX_IMAGES`] entries; loading a new image
|
||||
//! evicts the least recently used one. Entries remember the [`Resource`]
|
||||
//! they were loaded from, so eviction drops the image from the sprite
|
||||
//! atlas *and* removes the asset from the asset system — freeing the raw
|
||||
//! fetched bytes alongside the decoded image.
|
||||
//! * [`clear_on_release`] drops the whole cache when an image-heavy view
|
||||
//! (`RepoDetailView`, `IssuesView`) is released, i.e. its panel closes.
|
||||
//! * [`clear`] drops everything on demand from anywhere in the app.
|
||||
//!
|
||||
//! Images that get cleared are re-fetched and re-decoded the next time they
|
||||
//! are rendered, so clearing trades a little bandwidth/CPU for memory.
|
||||
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::mem::take;
|
||||
use std::sync::Arc;
|
||||
|
||||
Reference in New Issue
Block a user