forceReload method

void forceReload(
  1. ScalableImageSource src
)

If the image referenced by src is in the cache, force it to be reloaded the next time it is used.

Implementation

void forceReload(ScalableImageSource src) {
  final _CacheEntry? old = _canonicalized.remove(src);
  if (old == null) {
    return;
  }
  final e = _CacheEntry(src, src.createSI());
  _canonicalized[src] = e;
  if (old._refCount > 0) {
    e._refCount = old._refCount;
    assert(old._lessRecent == null && old._moreRecent == null);
  } else {
    e._lessRecent = old._lessRecent;
    e._moreRecent = old._moreRecent;
    assert(e._lessRecent!._moreRecent == old);
    e._lessRecent!._moreRecent = e;
    assert(e._moreRecent!._lessRecent == old);
    e._moreRecent!._lessRecent = e;
  }
}