Commit Graph

63 Commits

Author SHA1 Message Date
Aaron Hill 1b3070ab85 core: Make `BitmapHandle` hold a trait object instead of an id
`BitmapHandle` now holds `Arc<dyn BitmapHandleImpl>`.
This allows us to move all of the per-bitmap backend data into
`BitmapHandle`, instead of holding an id to a backend-specific
hashmap.

This fixes the memory leak issue with bitmaps. Once the AVM side of a
bitmap (`Bitmap`/`BitmapData`) gets garbage-collected, the
`BitmapHandle` will get dropped, freeing all of the GPU resources
assoicated with the bitmap.
2022-12-03 19:44:44 -06:00
Marco Grassi ad81b3bf14 upgrade lock and toml dependencies 2022-11-26 14:04:59 -05:00
Aaron Hill 3bef8c4fd6 render: Remove `get_bitmap_pixels` and store data in `Character::Bitmap`
We only called `get_bitmap_pixels` when creating a `BitmapData`
for an SWF-provided `Bitmap`. We now store the initial pixels
in `Character::Bitmap`, and use them to initialize a `BitmapData`
when needed.

This lets us simplify the wgpu backend, which no longer needs
to store a `Bitmap` object. In addition to saving space for
`BitmapData` objects that lack an SWF `Bitmap`, this will make
it easier to move data from `bitmap_registry` into `BitmapHandle`
itself.
2022-11-25 16:08:42 -07:00
relrelb 178bf4fe24 chore: Extract Cargo `edition` to `[workspace.package]`
This is possible since Rust 1.64.0: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
2022-10-14 22:13:29 +03:00
Aaron Hill 423d7e4cc4 render: Treat `update_texture` with invalid `BitmapHandle` as an error
This should be impossible to trigger from ActionScript, so
we shouldn't ignore it.
2022-09-16 22:03:15 -06:00
= f0013bdec8 video: Moved individual decoders to software video backend 2022-09-04 17:46:58 -07:00
= bf242bfb09 video: Moved SoftwareVideoBackend to software decoder crate 2022-09-04 17:46:58 -07:00
= 7c839ef8ae video: Add software video crate, moved VideoDecoder to it 2022-09-04 17:46:58 -07:00
= 8b12185d61 video: Moved NullVideoBackend from core to video 2022-09-04 17:46:58 -07:00
= aff49cd891 video: Moved VideoBackend from core to video 2022-09-04 17:46:58 -07:00
= 7c464295e2 video: Moved VideoStreamHandle from core to video 2022-09-04 17:46:58 -07:00
= fd7086adef video: Moved EncodedFrame, DecodedFrame and FrameDependency from core to video 2022-09-04 17:46:58 -07:00
= b7cf800f88 video: Made ruffle_video crate, moved core video Error to it 2022-09-04 17:46:58 -07:00