This simplifies the renderer handling - the FontRequest arriving there
will always be resolved.
And this reduces the amount of property dependencies: If a Text elements
specifies a font-family, no dependency to the window's
default-font-family is created.
Every backend will do something different with the string that needs to go into the clipboard.
Qt will convert it to a QString, copypasta to a String, in theory it could be written
directly to a socket.
Given that we don't know what the perfect representation on the backend side is, passing
a string slice avoids any immediate conversions.
Instead of a new() function and a start() and no stop() function, create the collector
when we want to measure and drop it when we're done.
This will also make it possible to move the collector into the renderer
in the future.
For embedded images the path is empty but we unconditionally used it to create a TextureCacheKey,
which clashes.
Instead, preserve and store the ImageCacheKey in the ImageInner variants.
This includes the cache of decoded images, the HTMLImage element support
and the SVG rendering adapter.
The objective is that Image holds an ImageInner, which is not a path
anymore that the backend has to process, but instead always either
decoded image data, a pointer to a static texture or an SVG tree that
can be rendered to the desired size.
```
warning: unused return value of `alloc::boxed::Box::<T>::from_raw` that must be used
Warning: --> internal/core/properties.rs:382:9
|
382 | Box::from_raw(_self as *mut BindingHolder<B>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
```
Just do what the note says
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.
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.
... via two ways bindings
Otherwise we could be in a case where we have an unbounded number of "shared" property
which might not be shared anymore if the original property goes out of scope