Repository navigation
fix(runtime): release retained Pixels and image atlas pages when hidden - #2686
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2675.
Summary
RuntimeCore::drop_images()(moved fromruntime/frame.rstoruntime/rest.rs, previously Wayland-overlay-only) to clearImageAtlasCPU pages and drop every retainedPixels/Imagereference across:tree.nodes(VisualCold::pixels,VisualCold::image_menu,PillChip::image,BareIcon::image,InputSpec::pill_image)tree.spare_nodescommit.memo(tracked viaBuilt::has_pixels/Shared::has_pixels, so memos without images stay cached and image-free windows are not marked dirty)commit.virtual_inputs(InputSpec::pill_image) andcommit.virtuals(PinnedSelection::storedelements and offscreenPinspill images)drop_images()on every unseen/hidden path:Host:give_back(true)(non-launcher),hide_window,set_cover(covered), andreleaseOverlayCore:give_back(true)andstop_drawing(includingRelease::Now)commit_hiddenbeforerest()Runtime:Runtime::rest()when!live_visible(), plusRuntimeCore::finish_updateandRuntimeCore::poll_alonewhen state changes while!live_visible()(without rebuilding the view while hidden)give_back(false)and visibleRuntime::rest()keep currently displayed images and atlas pages warm.commit.dirtyis set so the next visible frame rebuilds and re-uploads whatever images the view still shows.Verification
runtime::rest::tests(3 new regression tests provingWeak::upgrade()drops toNoneacrossEl::pixels,memo, clippedmemo,pill_with_image,inline_image,pill_image,image_menu,virtualize, hiddenrest(), hiddenupdate(), and hiddenpoll),overlay::rest_tests,overlay::state_walk_tests::wayland_hide_drops_pixels,overlay::tests::overlay_pixels_wake_only_while_shown_and_catch_up_on_show,overlay::retire::tests::drop_hidden_images,render::upload::tests::give_back,runtime::drop_tests,runtime::hidden_wake_tests,runtime::live_only_tests, andwindow::state::covered_tests(all passed).cargo check -p rune --target wasm32-unknown-unknown(passed).