Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] ImageGallery: Increase the GridView's cache capacity #1855

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

cbentejac
Copy link
Contributor

@cbentejac cbentejac commented Dec 22, 2022

Description

The "cacheBuffer" property determines whether delegates are retained outside the visible area of view. In the case of the ImageGallery, it determines whether the images that are not currently visible in the GridView (because we need to scroll up or down to be able to see them) will remain in the cache or not. The default value is platform-dependent (but seems to be 320 for maintream systems) and currently causes any image that is not directly visible to be lost, even if it was previously loaded when it appeared in the view: if we scroll up or down, we will necessarily need to wait for the images to be loaded again.

This PR increases the value of the "cacheBuffer" property to keep more images, even if they are not currently visible, in the cache. This improves the navigation in the Image Gallery, as shown below (left: previous behaviour with default cacheBuffer value; right: new behaviour with increased cacheBuffer value):

=>

Implementation remarks

  • 10000 is an arbitrary cacheBuffer value that seems to work correctly for most cases.

The "cacheBuffer" property determines whether delegates are retained
outside the visible area of view. In the case of the ImageGallery,
it determines whether the images that are not currently visible in
the GridView (because we need to scroll up or down to be able to see
them) will remain in the cache or not. The default value is platform-
dependent (320 for Windows) and currently causes any image that is not
directly visible to be lost, even if it was previously loaded when it
appeared in the view: if we scroll up or down, we will necessarily need
to wait for the images to be loaded again.

10000 is an arbitrary value that seems to work correctly for most cases.
@cbentejac cbentejac self-assigned this Dec 22, 2022
@fabiencastan fabiencastan added this to the Meshroom 2022.1.0 milestone Dec 22, 2022
@fabiencastan fabiencastan merged commit 1f64420 into develop Dec 22, 2022
@fabiencastan fabiencastan deleted the dev/imgGalleryCacheBuffer branch December 22, 2022 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants