Similar to commit 0fe29cd196 we need
to wrap access to the event loop :(
hide() is directly exposed in public API,
request_window_properties_update() will be called from outside the event
loop when we expose create_with_existing_window() for the interpeter to
re-use the canvas (which calls set_component on the window).
Commit 05b16bed89 introduced an exception
for SVGs images to treat them as premultiplied, but commit
3ef35c5ef9 accidentally applied the flag
to all HTML images, which is wrong.
In previous version, we were setting the constraint with wasm after
the window was shown, but this is no longer the case because we delay
the window creation by an iteration of the event loop.
Now should apply the constraint before showing the window.
But on wasm, we also must manually enforce these constraint because the
size given to the WindowBuilder is not applied
When opting into the Skia renderer, we default to metal on macOS and D3D on Windows.
However if you want to develop a cross-platform application with Skia and
for example rely on OpenGL to be able to implement an OpenGL underlay or overlay,
then we need the ability to explicitly opt into skia's GL renderer.
cc #1445
Similar to commit 957186acb7 we need to take the blur into account in the box shadow image:
We add blur margins around the entire image, but we also need to start drawing at (blur, blur) instead of (0, 0).
The same offset needs to be subtracted again when drawing the cached image.
Despite the blur being an abstract float, in reality in femtovg as well
as Skia it's a pixel radius. Commit
1a8a295e38 removed the scaling to physical
pixels, which was wrong. This restores it and along with it the same
appearance as before.
Creating a new window requires access to an event loop instance. The
winit upgrade prevents us from creating multiple EventLoop instances.
Therefore we have to re-use the existing event loop instance, which is
only accessible from within the event handler.
Closes#1545
Not that `SoftwareRenderer::new()` takes the Weak by value instead of
by reference, because coercing a reference to a `Weak` to a `&Weak<dyn>`
is not possible, while converting a Weak to a `Weak<dyn>` just works.
This reverts commit 7f2868b5a0.
This is still causing issues on Windows, as reported by tay64 on
Mattermost. This is a box (no vmware) with an ATI driver.
Vendor: ATI Technologies Inc.
Version: 4.6.14761 Core Profile Forward-Compatible Context 21.30.23.04 30.0.13023.4001
If we (or the user) ends up calling hide() on a window after returning from the event loop, our
attempt at posting an event would panic in winit as we
try to create a new event loop instances.
Since Winit 0.27 a panic is raised when creating an event loop instance a second time.