5#include "flutter/shell/platform/android/image_lru.h"
10 std::optional<HardwareBufferKey>
key) {
11 if (!
key.has_value()) {
14 auto key_value =
key.value();
16 if (images_[
i].
key == key_value) {
18 UpdateKey(
result, key_value);
27 if (images_[0].
key ==
key) {
36 for (
auto j =
i; j > 0; j--) {
37 images_[j] = images_[j - 1];
45 bool updated_image =
false;
47 if (images_[
i].
key == lru_key) {
62 images_[
i] =
Data{.key = 0u, .value =
nullptr};
HardwareBufferKey AddImage(const sk_sp< flutter::DlImage > &image, HardwareBufferKey key)
Add a new image to the cache with a key, returning the key of the LRU entry that was removed.
sk_sp< flutter::DlImage > FindImage(std::optional< HardwareBufferKey > key)
Retrieve the image associated with the given [key], or nullptr.
void Clear()
Remove all entires from the image cache.
sk_sp< const SkImage > image
static constexpr size_t kImageReaderSwapchainSize
struct PathData * Data(SkPath *path)
uint64_t HardwareBufferKey