These logs perform somewhat expensive evaluation (crossing the Wasm-
JS boundary). So use the cheaper `log_enabled!()` macro to avoid
evaluation if the relevant log level is not enabled.
This interface handles returning a bitmap given an ID and is used
by the render backend to get the bitmap used for a bitmap fill.
This will allow for bitmap fills in the drawing API, as these will
manage their own list of bitmaps.
This also removes the MovieLibrary dependency from render backends
and will allow for better decoupling in the future.
Matrices in an SWF file store their scale/skew components in
in 16.16 format (fbits).
Split `ruffle_core::Matrix` and `swf::Matrix`. `swf::Matrix` now
stores its data as `Fixed16` instead of immediately converting to
`f32`.
Use the proper types for ColorTransform:
* Fixed8 (8.8) format for multiplicative component
* i16 format for additive component
This matches the behavior of Flash (for example, alpha only changes
in units of 1/256).
* #[derive(Collect)] should be before #[collect]
* Replace redunant `&buf[..]` with `buf`
* Changes most cases of UPPERCase to UpperCase
* Allow upper_case_acronym on most SWF types, as they are from
SWF spec/more annoying to change.
Switch to debug_assert! instead of assert! in mask checks to avoid
panicking (#1347). This will render incorrectly and still needs
to be fixed, but we should fail gracefully and avoid killing the
entire player.
Pass the movie library to `register_shape` methods so that bitmap
charcter IDs can be resolved immediately on the proper SWF.
This fixes#2037, which cause incorrect bitmaps to be used when
multiple movies were loaded.
Change the usage of the stencil buffer to avoid running out of
stencil bits when too many nested masks are active.
This also cleans things up on wgpu which requires us to make
pipeline states in advice; now we only need a few stencil states
for masking as opposed to hundreds.