Previously, all the closures passed to `get_or_update_cache_entry` would
have to make sure that the scale factor is an included dependency. This
is error prone, as the parent commits show.
Instead, this change adds a property tracker to each ItemCache and lets
the renderer clear the cache if the scale factor changes.
Strictly speaking this may delete too many entries from the cache (not
all depend on the scale factor), but on the other hand this doesn't
happen very often so we trade robustness over efficiency.
- Use WinitSkiaRenderer for the adapter in the winit backend (similar to WinitSoftwareRenderer)
- Use SkiaItemRenderer for the impl of the ItemRenderer trait
The cursor is loaded by the window adapter from the cache. When it's
loaded the first time, its format will be Svg, so we convert it to a
pixel buffer. That way the skia backend can convert it on first draw
into a skia_safe::Image and replace the cache entry with the backend
storage variant.
So that we don't need to query the geometry multiple time, and this pave
the way to not have the geometry in the items
Part of #1932
As a drive by, fix the clipping of the Path element which incorrectly
offseted the clip by (x,y).
Similar fixes happen in the Clip element in some renderer, but that
didn't have effect because x and y are always 0 for the Clip element
- This allows creating the Skia GL interface without string allocations
- Port the item renderer to use SkImageFilters::Shader instead of
SkImageFilter::Paint
Return the path events for rendering as an Option, so that if the path is empty,
we simply return.
This avoids a double property dependency in the (likely) event the path is not empty.
Instead of the ClippedImage. Because we use the colorize property more
often than the source property, and these are soon going to be even more
expensive
Commit f66a2a5775 and dc048a11db introduced
the regression of issue #1985 where in adjust_rect_and_border_for_inner_drawing
instead of subtracting the entire border width from the size,
only half of it was subtracted,
leaving an inner area of the rectangle visible.
Fixes#1985
The crate is an internal crate until the API has been polished and
documented, after which we can call slint-renderer-skia for example.
This also duplicates a little bit of the glutin setup code, because
that would otherwise have to go into another shared crate.