-
Notifications
You must be signed in to change notification settings - Fork 323
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
Fix disappearing cached shapes #6458
Conversation
if !self.camera_ready.get() { | ||
// We cannot render before the camera's transformation matrix has been set. | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it won't hurt to make if-else instead of early return.
let handle = frp::microtasks::next_microtask({ | ||
let camera = self.layer.camera(); | ||
let scene = self.scene.clone_ref(); | ||
let camera_ready = Rc::clone(&self.camera_ready); | ||
move || { | ||
camera.update(&scene); | ||
camera_ready.set(true); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we are updating cameras in Scene::update_layout
How does this code relate to the update functions in Scene? Everything is probably fine, but I do not understand yet why we are handling the same thing in two places (or maybe my knowledge about the (EnsoGL) world is not up to date now ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update finishes asynchronously now, due to the batch
FRP used in layer updates. Other layers work OK because we poll their dirty flags unconditionally when processing all updates, so they eventually see the results of all microtasks--but this layer is only updated once, and its draws only occur once, so we need to know when it's ready.
let internal_format = texture::Rgba; | ||
let internal_format = texture::Rgba8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, if we've been using wrong format, how on earth was it working? :O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rgba
isn't wrong; used with u8
channel values, it is usually equivalent to using Rgba8
. However, in some situations the more specific Rgba8
value can produce a complete texture, when Rgba
would not; and there are driver (and browser)-specific differences between handling of incomplete textures... So, although there should be more difference here, I think it is safest to provide the most specific value possible.
* develop: (34 commits) Continued Execution Context work and some little fixes (#6506) IDE's logging to a file (#6478) Fix application config (#6513) Cloud/desktop mode switcher (#6448) Fix doubled named arguments bug (#6422) Reimplement `enso_project` as a proper builtin (#6352) Fix layer ordering between dropdown and breadcrumbs backgrounds. (#6483) Multiflavor layers (#6477) DataflowAnalysis preserves dependencies order (#6493) Implement `create_database_table` for Database Table (#6467) Limit Dead Letter logging (#6482) More reliable shutdown of the EnsoContext to save resources (#6468) Make execution mode `live` default for CLI (#6496) Finishing Vector Editor (#6470) Proper handling of multiple list views. (#6461) Fix disappearing cached shapes (#6458) Add Execution Context control to Text.write (#6459) Change defaults for `Connection.tables` and ensure that `Connection.query` recognizes all available tables (#6443) Introducing @BuiltinMethod.needsFrame and InlineableNode (#6442) Hide profile button behind a feature flag (#6430) ...
Pull Request Description
Fix cached-shapes disappearance when resizing window or moving to differently-shaped monitor (#6125).
The bug:
CacheShapesPass
relied on old behavior ofdisplay_object.update(..)
: The update used to be finished when the call returned, but now it spawns an asynchronous task. It is now necessary to schedule a task to update the layer's camera after the scene's display object update has propagated its transformation matrix to the pass's layer.Additional optimization:
Some cleanups:
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Unit tests have been written where possible../run ide build
.