ruffle/render/src
Aaron Hill 93607aa86e
avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254)
* avm2: Implement `BitmapData.draw` for `wgpu` backend

This method requires us to have the ability to render directly to a
texture. Fortunately, the `wgpu` backend already supports this in
the form of `TextureTarget`. However, the rendering code required
some refactoring in order to avoid creating duplicate `wgpu` resources.

The current implementation blocks on copying the pixels back
from the GPU to the CPU, so that we can immediately set them in
the Ruffle `BitmapData`. This is likely very inefficient, but will
work for a first implementation.

In the future, we could explore allowing the CPU image data and GPU
texture to be out of sync, and only synchronized when explicitly
necessary (e.g. on `getPixel` or `setPixel` calls).

* Rename `with_offscreen_backend` to `render_offscreen` and use Bitmap

* Don't panic when backend doesn't implement `render_offscreen`
2022-09-06 16:38:48 -05:00
..
backend avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254) 2022-09-06 16:38:48 -05:00
backend.rs avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254) 2022-09-06 16:38:48 -05:00
bitmap.rs render: Remove `gc-arena` dependency 2022-09-02 09:49:18 -07:00
bounding_box.rs render: Remove `gc-arena` dependency 2022-09-02 09:49:18 -07:00
color_transform.rs render: Moved color_transform from core to render 2022-08-14 18:38:14 -07:00
error.rs avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254) 2022-09-06 16:38:48 -05:00
lib.rs render: Removed common_tess and moved tessellator to render 2022-08-14 18:38:14 -07:00
matrix.rs render: Moved Matrix from core to render 2022-08-14 18:38:14 -07:00
shape_utils.rs swf: Remove `Copy` from `Rectangle` 2022-09-02 18:21:13 -07:00
tessellator.rs render: Removed common_tess and moved tessellator to render 2022-08-14 18:38:14 -07:00
transform.rs render: Remove `gc-arena` dependency 2022-09-02 09:49:18 -07:00
utils.rs render: Made render use a real Error enum and not generic box<error> 2022-08-25 23:43:21 +02:00