Currently when clicking in a textbox, the cursor will only be placed
correctly if you click exactly on top of a letter. The basic purpose of
this commit is to make it so that clicking in the surrounding margin
will put the cursor in the closest available position, as in Flash Player.
The logic is a bit complex because a single row of text can contain
multiple layout boxes, each with a different Y offset (but all with the
same Y extent). To be accurate, we need to treat each layout box in the
row "as if" it had the same Y offset that the tallest box in its row has.
This commit also contains a fix for an issue where lower_from_text_spans
was passing the wrong text strings and indexes to fixup_line for
newlines, which needed to be fixed in order to be able to click to place
the cursor in an empty row that was created by newlines.
This patch ensures that sockets are closed properly.
Without it, when the application-end of the socket was closed,
the other end was left intact, and the socket was not closed.
This patch makes sure that any pending data is sent before
the socket closes. Without this fix Ruffle ignored the data sent
right before calling socket.close.
This improves testability, decouples ExternalNavigatorBackend
from the event loop, and improves readability.
Instead of passing a channel to send the future to and an event loop
to poll, a WinitFutureSpawner is created which performs the
action of spawning a future and polling the event loop.
This has several advantages:
1. it allows using async variants of send and recv,
2. it adds consistency as until now Receiver was async,
and Sender was not.
We hit a pathological case in House
(https://github.com/ruffle-rs/ruffle/issues/15154),
where eagerly decoding bitmaps during preloading results in
over 10GB of ram being used.
With this PR, we store the compressed bitmap, and only decode it
each time we instantiate it. In order to support bitmap fills,
we store the decoded width/height and a lazily-initialized GPU handle
in `Character::Bitmap`