Commit graph

12 commits

Author SHA1 Message Date
Simon Hausmann
9799571396 Make it possible to implement the ItemRenderer trait with a lifetime
The as_any() method returning a `&mut dyn Any` meant that the type has to be
'static. The class solution of returning &()
doesn't work because it has to be a mutable ref. Therefore just return an Option.
2022-07-12 20:37:14 +02:00
Simon Hausmann
0b20f58ada GL backend: speed up updates to layer content
Now that we store the layer textures as Rc<Texture>, before rendering a
layer we can take a clone of a possibly existing layer texture and if if
the layer's tracker is dirty, we can re-use the existing layer texture
if it's the same size.

This avoids unnecessary texture allocations.
2022-07-11 23:19:05 +02:00
Simon Hausmann
3ce9977f0a Add slint::Window::(set_)position
Fixes #323
2022-07-08 18:37:01 +02:00
Simon Hausmann
966e2586a6
Clean up texture caching in the GL renderer (#1375)
Clean up texture caching in the GL renderer

In preparation for moving the image decoding and caching of decoded
image data into the core library, change the texture cache to be really
a cache of textures. Previously it cached Rc<CachedImage>, which could
have also been just a CPU side image. However this was "run-time"
asserted. Instead, with this patch it's an `Rc<Texture>` and that will
always be GPU side.
2022-06-27 19:01:00 +02:00
Simon Hausmann
565262f5c1 Fix formatting
Re-ran `cargo fmt`
2022-06-08 09:23:31 +02:00
pubg-hacks
aed71311ca Add a read-only propery to TextInput, LineEdit and TextEdit 2022-06-08 09:23:01 +02:00
Simon Hausmann
52b82632e1 janitor: remove unnecessary function parameter 2022-06-08 09:06:31 +02:00
Olivier Goffart
6cbf2c0609 Put the new cache in corelib and use it in the GL backend 2022-05-31 10:48:24 +02:00
Olivier Goffart
d2186593c0 Pass the ItemRc to each draw_function
So that it can be used as a key to the cache
2022-05-31 10:48:24 +02:00
Tobias Hunger
18cbda0269 janitor: Run cargo clippy --fix 2022-05-22 11:59:00 +02:00
Olivier Goffart
b4ebd88d35 Implements @radial-gradient(circle, ...)
Only the circle is implemented so far.

Part of #263
2022-05-19 14:07:20 +02:00
Simon Hausmann
eb3ceb54bd janitor: Move the GL renderer into a separate module 2022-04-20 17:41:53 +02:00