and use Rc<dyn PlatformWindow> instead. The alias has to stay with the ffi
functions though and the item vtable definitions,
because we don't have an Rc<> template in C++.
Previously: Window is an Rc<WindowInner>, which has an Rc<dyn
PLatformWindow> - and weak references the other way around.
Now: Rc<dyn PlatformWindow> is the root of window ownership. The impl
PlatformWindow has a slint::api::Window, which just holds a WindowInner.
This change is incomplete on a few levels, mainly that neither of the
code generators nor the interpreter is ported.
For hide() we don't really need Rc<Self>, and for show() we had Rc<Self> because
for example for winit we need a Weak<Self> for the thread-local mapping of
window id to window.
However that can be encapsulated in the PlatformWindow impl using Rc::new_cyclic,
there's no need to expose this in the trait.
Move the self_weak of WindowInner into the impl of PlatformWindow. Most implementations already have it anyway.
While right now the method returns a `WindowRc`, at the end of the series
it should return a `&Window`.
From that `&Window` we can get to `&WindowInner` and all receivers there
are `&self`.
Regression introduced in commit 0b06f97cfb
(there was an else)
Otherwise there are noticable delay after a touch as we go to sleep
instead of redrawing
This is is not really working anyway and relies on private API. The constant optimization could be
done perhaps as an option in the sw
renderer later, if it's still worth it.
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
Because re-generating the Skia image is slow and there is no point
storing both the image buffer and the SkiaImage in the cache as it
is basically the same information.
Remove the renderer-skia-opengl "dev" feature again, as on Windows with a
--all-features build in the CI it'll cause
Skia to be built from source. That's not possible in the CI due to long paths as the skia submodule is checked out.
Remove release_graphics_resources() as it's always connected to dropping
the entire renderer's canvas. That one in turn is already prepared, i.e.
for femtovg it makes sure that the context is current.
Move the rendering notifier into the Renderer. This duplicates a little bit of code, but it
(1) Allows for avoiding the flush of femtovg/skia if no rendering notifier is
registered
(2) Paves the way of gracefully handling the situation where the renderer doesn't support this yet
Commit 0ee361d994 regressed on
https://github.com/slint-ui/slint/issues/1269 as the inner_size()
returned at the time during event processing is already the future
value, that will change again when processing the resize event.
Instead of storing the last received value, process the event at the
appropriate MainEventsCleared stage.
Resize the glutin context when we receive a resize event from winit.
This is the approach recommended by glutin/winit's documentation.
This approach also avoids jitter when rendering with metal (not
implemented yet, but tested locally :)
This field duplicates the winit window's inner size. It is set on a
WindowEvent::Resized(), after which
`winit:🪟:Window::inner_size()` returns the same value.
Colorization is typically implemented using an intermediate layer and since
usually it doesn't change so often, it's faster to cache the result in the existing SkImage cache
per Image item.
Go through the default font manager in style matching first, so that the empty family is matched against system defaults.
Otherwise the first registered custom font because the overall default.