Commit Graph

12705 Commits

Author SHA1 Message Date
Kamil Jarosz 59c0bcf073 core: Improve EditText's border and background rendering
This patch removes the drawing used for rendering the border and
the background and renders them using primitives instead.

It provides two methods for drawing the border and the background:
* draw_device_text_box -- when device fonts are used,
* draw_text_box -- when fonts are embedded.

Updated expected images in tests as they are closer to FP now:
* text/auto_size/height,
* text/auto_size/return,
* text/auto_size/width,
* visual/shumway_acid_tests/acid_color_0.

For the test avm2/stage3d_texture it's hard to say whether the current
output is closer to FP or not, as FP renders it with a different scale.
However, I have confirmed that there exists a scale at which FP renders
the text fields exactly as Ruffle after this patch.
2024-07-02 23:40:50 +02:00
Kamil Jarosz d86d69f791 render: Implement drawing lines using canvas
This patch provides an efficient implementation of draw_line
and draw_line_rect for canvas using strokes.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 2ba5e47b59 render: Implement drawing lines using WebGL
This patch provides an efficient implementation of draw_line
and draw_line_rect for WebGL using Gl::LINE_STRIP.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 9ba6569a2e render: Implement drawing lines using wgpu
This patch provides an efficient implementation of draw_line
and draw_line_rect for wgpu using PrimitiveTopology::LineStrip.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 7dd4d2006e render: Add primitives for drawing lines
This patch adds draw_line and draw_line_rect methods to CommandHandler,
providing empty impls to be overridden by corresponding backends.

The ability to draw lines is described using a new bitflags struct
RenderBackendFeatures, which contains a set of features
supported by the given render backend.
Currently, it contains a DRAW_LINES flag, which informs whether
the backend supports drawing lines as primitives.
2024-07-02 23:40:50 +02:00
Kamil Jarosz cff1b14409 render: Emulate drawing lines using quads 2024-07-02 23:40:50 +02:00
Kamil Jarosz 23931ed863 render: Refactor chunk_blends to use CommandHandler
This refactor simplifies code, gets rid of the large number of
parameters, and allows calling other rendering methods from themselves.
The latter is useful for emulating lines on Dx12.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 23f01e0dd9 render: Add Matrix::create_box_with_rotation
This patch splits the current method of create_box into
1. create_box -- without rotation, and
2. create_box_with_rotation -- with rotation.

The reason for that refactor is that create_box was often used without
rotation, and always passing 0.0 as rotation and having
a dedicated condition for 0.0 was superfluous.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 78b2d84fa7 swf: Add ColorTransform::multiply_from
This method is used to instantiate ColorTransform with its
multiplicative component equal to the given color.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 2d6eefd622 swf: Add rounding methods to Twips 2024-07-02 23:40:50 +02:00
Kamil Jarosz 4302fe2e70 swf: Add Twips::HALF
Twips::HALF represents 10 twips, i.e. 0.5 pixels.
This constant is useful when calculating exact positions of lines
to be drawn, as they are often drawn on whole pixels.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 28b86490cc render: Draw quads using Gl::TRIANGLE_FAN for WebGL
This patch changes the mode of drawing quads to Gl::TRIANGLE_FAN.
This makes the buffers smaller, as we need only 4 vertices instead of 6,
and allows them to be reused for rendering lines.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 07df84a486 render: Add WebGlRenderBackend::draw_quad
Moving draw_rect to draw_quad prevents code duplication when
methods related to drawing lines are added.
2024-07-02 23:40:50 +02:00
Marco Bartoli fe08638d26
Implement ImportAssets/ImportAssets2 (#16420) 2024-07-02 11:41:48 +00:00
Aaron Hill 617cb3330d avm2: Ignore ClassObject call receiver
This allows a class to be used with `callproplex`
2024-07-02 07:18:22 -04:00
Lord-McSweeney 0c4080386d tests: Add test for reusing Loader 2024-07-02 06:58:37 +03:00
Lord-McSweeney 83d0316ac3 avm2: Add stub notices for reusing Loader 2024-07-02 06:58:37 +03:00
Lord-McSweeney d2e3de4cc4 avm2: Unload the contents of a Loader before `load` and `loadBytes` 2024-07-02 06:58:37 +03:00
Aaron Hill ebab349458 avm2: Stub Stage.mouseLock 2024-07-01 23:13:02 -04:00
Crowdin Bot 2093d950e5 chore: Update translations from Crowdin 2024-07-02 01:21:48 +02:00
dependabot[bot] 28aa2e65a9 build(deps): bump the cargo-minor group across 1 directory with 7 updates
Bumps the cargo-minor group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.7` | `4.5.8` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.5.0` | `2.6.0` |
| [log](https://github.com/rust-lang/log) | `0.4.21` | `0.4.22` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.117` | `1.0.120` |
| [num-bigint](https://github.com/rust-num/num-bigint) | `0.4.5` | `0.4.6` |
| [id3](https://github.com/polyfloyd/rust-id3) | `1.13.1` | `1.14.0` |
| [either](https://github.com/rayon-rs/either) | `1.12.0` | `1.13.0` |



Updates `clap` from 4.5.7 to 4.5.8
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8)

Updates `bitflags` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0)

Updates `log` from 0.4.21 to 0.4.22
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.21...0.4.22)

Updates `serde_json` from 1.0.117 to 1.0.120
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.120)

Updates `num-bigint` from 0.4.5 to 0.4.6
- [Changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-bigint/compare/num-bigint-0.4.5...num-bigint-0.4.6)

Updates `id3` from 1.13.1 to 1.14.0
- [Changelog](https://github.com/polyfloyd/rust-id3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/polyfloyd/rust-id3/compare/v1.13.1...v1.14.0)

Updates `either` from 1.12.0 to 1.13.0
- [Commits](https://github.com/rayon-rs/either/compare/1.12.0...1.13.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: num-bigint
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: id3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 01:04:52 +02:00
dependabot[bot] 353fa41a7f build(deps): bump the npm-minor group in /web with 10 updates
Bumps the npm-minor group in /web with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `7.14.1` | `7.15.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `7.14.1` | `7.15.0` |
| [mocha](https://github.com/mochajs/mocha) | `10.5.0` | `10.5.2` |
| [typescript](https://github.com/Microsoft/TypeScript) | `5.5.2` | `5.5.3` |
| [tsx](https://github.com/privatenumber/tsx) | `4.15.7` | `4.16.0` |
| [chromedriver](https://github.com/giggio/node-chromedriver) | `126.0.3` | `126.0.4` |
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `48.4.0` | `48.5.0` |
| [replace-in-file](https://github.com/adamreisnz/replace-in-file) | `8.0.0` | `8.0.1` |
| [typedoc](https://github.com/TypeStrong/TypeDoc) | `0.26.2` | `0.26.3` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `5.3.1` | `5.3.2` |


Updates `@typescript-eslint/eslint-plugin` from 7.14.1 to 7.15.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/v7.15.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 7.14.1 to 7.15.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.15.0/packages/parser)

Updates `mocha` from 10.5.0 to 10.5.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.5.0...v10.5.2)

Updates `typescript` from 5.5.2 to 5.5.3
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.2...v5.5.3)

Updates `tsx` from 4.15.7 to 4.16.0
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.15.7...v4.16.0)

Updates `chromedriver` from 126.0.3 to 126.0.4
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.3...126.0.4)

Updates `eslint-plugin-jsdoc` from 48.4.0 to 48.5.0
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.4.0...v48.5.0)

Updates `replace-in-file` from 8.0.0 to 8.0.1
- [Release notes](https://github.com/adamreisnz/replace-in-file/releases)
- [Changelog](https://github.com/adamreisnz/replace-in-file/blob/main/CHANGELOG.md)
- [Commits](https://github.com/adamreisnz/replace-in-file/commits)

Updates `typedoc` from 0.26.2 to 0.26.3
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.26.2...v0.26.3)

Updates `vite` from 5.3.1 to 5.3.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.2/packages/vite)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: replace-in-file
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 22:46:01 +02:00
Lord-McSweeney 67c9936bf4 avm2: Use proper coercion in XMLList prototype methods 2024-07-01 18:40:47 +02:00
Crowdin Bot 4b849cd52a chore: Update translations from Crowdin 2024-07-01 01:17:52 +02:00
Nathan Adams 07cfa51731 web: Use automatic publicPath in extension 2024-06-30 23:42:23 +02:00
Nathan Adams fd5ca6ae39 web: Specify the correct path of assets for webpack in extension 2024-06-30 21:00:28 +02:00
Wumbo 5addb6e349 web: Fix keyboard input test (hopefully) 2024-06-30 13:23:16 +02:00
Wumbo 579df56ac0 web: Display save manager correctly in quirks mode 2024-06-30 13:23:16 +02:00
Wumbo 24f587a61e web: Improve clipboard modal 2024-06-30 13:23:16 +02:00
Wumbo e315709e1f web: Improve hardware acceleration modal 2024-06-30 13:23:16 +02:00
Wumbo aa26ca1d23 web: Improve video modal 2024-06-30 13:23:16 +02:00
Wumbo f078fc3b39 web: Don't close modal upon right click
There was a general consensus in the Ruffle Discord that this
functionality was awkward and unneeded (on top of already not
working as intended).
2024-06-30 13:23:16 +02:00
Wumbo 64b7f2edb8 web: Use transforms for modals/context menu instead of position
This lets the context menu escape the bounds of the player and keeps
modals in the center of the player at small widths.
2024-06-30 13:23:16 +02:00
Wumbo e79efb9bd9 web: Enforce nowrap on context menu items
This resolves (literal) edge cases where opening the context menu
too close to the right-hand side of the player would inadvertently
wrap the lengthiest menu item.
2024-06-30 13:23:16 +02:00
Wumbo 45cbb4f14e web: Don't unnecessarily populate Save Manager 2024-06-30 13:23:16 +02:00
Wumbo fe944e017d web: Run formatter because I forgot to before 2024-06-30 13:23:16 +02:00
Wumbo dfe39f4a50 web: Improve modal/context menu behavior
- Open modals now dim the player and prevent interaction with the
  underlying content until it is closed
- Right-clicking outside of an open modal now closes it instead of
  displaying the browser context menu
- Fixed a regression where right-clicking with the Ruffle context
  menu open would open the browser context menu
2024-06-30 13:23:16 +02:00
Wumbo 158e2f8474 web: Core UI improvements
Dark mode support has been added to the context menu as well as the
the Volume and Save Manager modals. The latter two have also received
significant visual upgrades.
2024-06-30 13:23:16 +02:00
Nathan Adams 7905544296 web: Add onFirstLoad option to installRuffle; use it to configure webpack in selfhosted 2024-06-30 13:09:01 +02:00
Nathan Adams 9d4837547f web: Add (optional) options to installRuffle 2024-06-30 13:09:01 +02:00
Nathan Adams f9b0346973 web: Remove the publicAPI.registerSource(name) method, it wouldn't work the way you'd expect. Best keep it an implementation detail. 2024-06-30 13:09:01 +02:00
Nathan Adams 09fdbb9c43 web: sourceName of installRuffle should be required 2024-06-30 13:09:01 +02:00
Nathan Adams 97396a1007 web: Changed installRuffle to always work with window.RufflePlayer, saves boilerplate 2024-06-30 13:09:01 +02:00
Nathan Adams 6827d4f086 web: Rename PublicAPI.negotiate() to a more accurate installRuffle() 2024-06-30 13:09:01 +02:00
Tom Schuster 58c231588d core: Stop searching after finding the first default font 2024-06-30 11:32:06 +02:00
TÖRÖK Attila be65fbaef6 tests: No longer mark the Error1090XmlElementMalformed AVMPlus test as a known failure 2024-06-30 11:17:38 +02:00
TÖRÖK Attila 6aa2dde859 chore: Update quick-xml to 0.35.0 2024-06-30 11:17:38 +02:00
Crowdin Bot c07f5cfca5 chore: Update translations from Crowdin 2024-06-30 10:13:29 +02:00
TÖRÖK Attila 9d11eb9816 web/extension: Fix AMO submission status checking 2024-06-30 10:06:27 +02:00
Tom Schuster 5618a3d048 avm2: FP10 version DisplayObject rotationX/Y/Z and scaleZ
Fixes #16910
2024-06-30 09:48:40 +02:00