Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add missing raster cache LRU accounting to Get()#16431

Closed
cbracken wants to merge 1 commit into
flutter-team-archive:masterfrom
cbracken:raster-cache-accounting
Closed

Add missing raster cache LRU accounting to Get()#16431
cbracken wants to merge 1 commit into
flutter-team-archive:masterfrom
cbracken:raster-cache-accounting

Conversation

@cbracken

@cbracken cbracken commented Feb 5, 2020

Copy link
Copy Markdown
Contributor

RasterCache::Get() methods were not updating the RasterCache::Entry
access_count and used_this_frame fields, as is done in
RasterCache::Prepare(). This can result in onscreen images being evicted
from the cache as new entries are created (e.g. as new elements scroll
onscreen).

RasterCache::Get() methods were not updating the RasterCache::Entry
access_count and used_this_frame fields, as is done in
RasterCache::Prepare(). This can result in onscreen images being evicted
from the cache as new entries are created (e.g. as new elements scroll
onscreen).
@cbracken

cbracken commented Feb 5, 2020

Copy link
Copy Markdown
Contributor Author

See flutter/flutter#50226

@chinmaygarde chinmaygarde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect this is high priority for the linked b/ issue. But can we add a flow_unittests test case for this please? If urgent, feel free to land and I'll add a test.

Comment thread flow/raster_cache.cc
if (it == picture_cache_.end()) {
return RasterCacheResult();
}
Entry& entry = const_cast<Entry&>(it->second);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we dry this up just a little bit by creating a method that takes a key and returns a cache result whose entry has its access counted bumped already?

@cbracken

cbracken commented Feb 6, 2020

Copy link
Copy Markdown
Contributor Author

Fixes flutter/flutter#50226

@cbracken

cbracken commented Feb 6, 2020

Copy link
Copy Markdown
Contributor Author

Closed in favour of #16434.

@cbracken cbracken closed this Feb 6, 2020
@cbracken cbracken deleted the raster-cache-accounting branch February 6, 2020 21:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants