Commit Graph

7746 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
Adrian Wielgosik 0861153626 swf: make Clippy happy 2022-12-03 22:18:22 +01:00
Daniel Jacobs 5b9da62c0a ci: Try disabling image tests on Linux 2022-12-02 21:28:41 -07:00
Daniel Jacobs e8b16b0cce ci: Change actions/upload-artifact to v3 2022-12-02 21:28:41 -07:00
Daniel Jacobs dca2fa8d35 ci: Don't use specific Swatinem/rust-cache revision 2022-12-02 21:28:41 -07:00
Daniel Jacobs 1355f11e6b ci: Move to direct cargo commands instead of using actions-rs/cargo 2022-12-02 21:28:41 -07:00
Daniel Jacobs 9256cb3276 ci: Replace actions-rs/toolchain with dtolnay/rust-toolchain 2022-12-02 21:28:41 -07:00
Daniel Jacobs 1cb3dfbe03 ci: Upgrade Node 12 actions workflows 2022-12-02 21:28:41 -07:00
David Wendt ce35313094 Revert "Revert "avm2: Implement `TextField` scrolling parameters""
This reverts commit f08aa19cb7.
2022-12-02 21:41:20 -05:00
Adrian Wielgosik f08aa19cb7 Revert "avm2: Implement `TextField` scrolling parameters"
This reverts commit 230ef315a2.
2022-12-02 18:22:19 -07:00
David Wendt b323c086a9 chore: Another empty commit to fix formatting nits 2022-12-02 20:05:13 -05:00
David Wendt 3550ccb6e0 chore: Empty commit that technically changes a file for CI purposes 2022-12-02 19:58:54 -05:00
David Wendt 6c4f202b0d chore: Empty commit to test CI-related things 2022-12-02 19:16:51 -05:00
Adrian Wielgosik 1f9fe76f16 Revert "ci: Upgrade Node 12 actions workflows"
This reverts commit eae04a1884.
2022-12-02 16:35:52 -07:00
Adrian Wielgosik 1a699345b4 Revert "ci: Replace actions-rs/toolchain with dtolnay/rust-toolchain"
This reverts commit 136c05fb17.
2022-12-02 16:35:52 -07:00
Adrian Wielgosik a040c329b7 Revert "ci: Move to direct cargo commands instead of using actions-rs/cargo"
This reverts commit 872dee65e7.
2022-12-02 16:35:52 -07:00
Adrian Wielgosik d7e8df517f Revert "ci: Don't use specific Swatinem/rust-cache revision"
This reverts commit 5db1f46a3a.
2022-12-02 16:35:52 -07:00
David Wendt 230ef315a2 avm2: Implement `TextField` scrolling parameters 2022-12-02 22:40:22 +01:00
Daniel Jacobs 5db1f46a3a ci: Don't use specific Swatinem/rust-cache revision 2022-12-02 11:36:52 +01:00
Daniel Jacobs 872dee65e7 ci: Move to direct cargo commands instead of using actions-rs/cargo 2022-12-02 11:36:52 +01:00
Daniel Jacobs 136c05fb17 ci: Replace actions-rs/toolchain with dtolnay/rust-toolchain 2022-12-02 11:36:52 +01:00
Daniel Jacobs eae04a1884 ci: Upgrade Node 12 actions workflows 2022-12-02 11:36:52 +01:00
Marco Grassi bcf9badc8c add italian localization to the extension 2022-12-02 10:33:20 +01:00
dependabot[bot] 911427f4c0 build(deps-dev): bump eslint-plugin-jsdoc from 39.3.4 to 39.6.4 in /web
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.3.4 to 39.6.4.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.3.4...v39.6.4)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 10:01:10 +01:00
dependabot[bot] 1cb797cb88 build(deps-dev): bump @typescript-eslint/eslint-plugin in /web
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.42.0 to 5.45.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.45.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 01:09:11 +01:00
dependabot[bot] 3554b041b4 build(deps-dev): bump stylelint-config-prettier in /web
Bumps [stylelint-config-prettier](https://github.com/prettier/stylelint-config-prettier) from 9.0.3 to 9.0.4.
- [Release notes](https://github.com/prettier/stylelint-config-prettier/releases)
- [Commits](https://github.com/prettier/stylelint-config-prettier/compare/v9.0.3...v9.0.4)

---
updated-dependencies:
- dependency-name: stylelint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 00:12:02 +01:00
dependabot[bot] d3a0290bac build(deps-dev): bump stylelint from 14.14.0 to 14.15.0 in /web
Bumps [stylelint](https://github.com/stylelint/stylelint) from 14.14.0 to 14.15.0.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/14.14.0...14.15.0)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 23:50:16 +01:00
dependabot[bot] df55c09ebc build(deps-dev): bump @types/mocha from 10.0.0 to 10.0.1 in /web
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 23:36:35 +01:00
michiel2005 f4a988bdda
swf: Update link (#8650)
The original link is not working anymore so I put a link to the wayback machine in it's place that leads to the original document

Co-authored-by: Adrian Wielgosik <4729533+adrian17@users.noreply.github.com>
2022-12-01 20:29:09 +01:00
Marco Bartoli f2080e6d57
avm2: implement get and set of displayobject filters (#8623) 2022-12-01 02:31:35 +01:00
dependabot[bot] 281ca6a1b8 build(deps): bump insta from 1.21.1 to 1.21.2
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.21.1 to 1.21.2.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.21.1...1.21.2)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 12:36:14 +01:00
dependabot[bot] 83487ae5d1 build(deps): bump serde from 1.0.147 to 1.0.148
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.147 to 1.0.148.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.147...v1.0.148)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 10:04:26 +01:00
dependabot[bot] e3923e0d3d build(deps): bump syn from 1.0.103 to 1.0.104
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.103...1.0.104)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 20:47:36 -07:00
dependabot[bot] bbaeb8c1b6 build(deps): bump embed-resource from 1.7.2 to 1.7.4
Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) from 1.7.2 to 1.7.4.
- [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases)
- [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.7.2...v1.7.4)

---
updated-dependencies:
- dependency-name: embed-resource
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 01:11:46 +01:00
Calvin304 5d5a56a7a3 avm2: Address feedback to DropShadowFilter stub 2022-11-27 09:46:18 -05:00
Calvin304 e46fc4fe8a avm2: stub DropShadowFilter 2022-11-27 09:46:18 -05:00
Marco Grassi 0c851ecfde don't include all the features in chrono to avoid including the vulnerable time dependency 2022-11-26 14:04:59 -05:00
Marco Grassi 6873cda76e move away from unmaintained clipboard crate and use arboard crate 2022-11-26 14:04:59 -05:00
Marco Grassi ad81b3bf14 upgrade lock and toml dependencies 2022-11-26 14:04:59 -05:00
Aaron Hill b8745f0ff1 avm2: Partially implement Stage3D for wgpu backend
This PR implements core 'stage3D' APIs. We are now able
to render at least two demos from the Context3D docs - a simple
triangle render, and a rotating cube.

Implemented in this PR:
* Stage3D access and Context3D creation
* IndexBuffer3D and VertexBuffer3D creation, uploading, and usage
* Program3D uploading and usage (via `naga-agal`)
* Context3D: configureBackBuffer, clear, drawTriangles, and present

Not yet implemented:
* Any 'dispose()' methods
* Depth and stencil buffers
* Context3D texture apis
* Scissor rectangle

General implementation strategy:

A new `Object` variant is added for each of the Stage3D objects
(VertexBuffer3D, Program3D, etc). This stores a handle to the
parent `Context3D`, and (depending on the object) a handle
to the underlying native resource, via `Rc<dyn
SomeRenderBackendTrait>`).

Calling methods on Context3D does not usually result in an immediate
call to a `wgpu` method. Instead, we queue up commands in our
`Context3D` instance, and execute them all on a call to `present`.
This avoids some nasty wgpu lifetime issues, and is very similar
to the approah we use for normal rendering.

The actual rendering happens on a `Texture`, with dimensions
determined by `createBackBuffer`. During 'Stage' rendering,
we render all of these Stage3D textures *behind* the normal
stage (but in front of the overall stage background color).
2022-11-25 21:43:00 -07:00
Toad06 460458812b avm1: Correct some properties in SWFv4 2022-11-25 20:35:59 -07:00
Aaron Hill 104b2265f2 Fix rebase fallout 2022-11-25 16:08:42 -07: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
David Wendt 14f27a9e4a docs: Fix up Twips2D doctests 2022-11-23 20:45:37 -07:00
David Wendt a5a6189e61 chore: Remove empty files and outdated references 2022-11-23 20:45:37 -07:00
David Wendt 84b3162a57 chore: cargo fmt & fixes 2022-11-23 20:45:37 -07:00
Mark Richins d345523d02 Fix conflicts 2022-11-23 20:45:37 -07:00
Mark Richins 9941701b3a Fix: change twips_2d to use x and y and fix bug 2022-11-23 20:45:37 -07:00
Mark Richins 63a291ac4b Fix promblems caused by moving Twips 2022-11-23 20:45:37 -07:00
Mark Richins ca6c98785a Rename Twips2d.rs to twips_2d.rs 2022-11-23 20:45:37 -07:00