Commit Graph

9108 Commits

Author SHA1 Message Date
Nathan Adams ab534bab87 core: Rename BitmapData (of the stage variety) to BitmapGraphicData to separate it from BitmapData of the editable data variety 2023-04-03 18:25:20 +02:00
Nathan Adams e1e4a01f13 avm2: Make BitmapDataObject::from_bitmap_data take BitmapDataWrapper 2023-04-03 18:25:20 +02:00
Nathan Adams 103158101a avm2: Make Object::init_bitmap_data take in BitmapDataWrapper 2023-04-03 18:25:20 +02:00
Nathan Adams a80a1422b0 avm2: Renamed bitmap_data_wrapper into bitmap_data 2023-04-03 18:25:20 +02:00
Nathan Adams 0f81d60db2 avm1: Removed BitmapDataObject::bitmap_data() as it's no longer used (or recommended to use) 2023-04-03 18:25:20 +02:00
Nathan Adams 7ffdcccf8a avm1: Don't sync in BitmapData.loadBitmap() 2023-04-03 18:25:20 +02:00
Nathan Adams f8ef01d2ef avm1: Don't sync a bitmapdata to read its width or height 2023-04-03 18:25:20 +02:00
Nathan Adams c037e014c2 avm1: Don't sync in new Bitmap(x) 2023-04-03 18:25:20 +02:00
Nathan Adams e593541309 avm1: Don't sync bitmapdata when disposing it 2023-04-03 18:25:20 +02:00
Nathan Adams f7da335083 avm2: Renamed as_bitmap_data_wrapper into as_bitmap_data 2023-04-03 18:25:20 +02:00
Nathan Adams 1521c7b6ee avm2: Removed Object::as_bitmap_data() as it's no longer used (or recommended to use) 2023-04-03 18:25:20 +02:00
Nathan Adams b1f7fecacb avm2: Don't sync in new Bitmap(x) 2023-04-03 18:25:20 +02:00
Nathan Adams 444e256708 avm2: Made Bitmap.bitmapData not recreate a new BitmapDataWrapper every time its called 2023-04-03 18:25:20 +02:00
Tom Schuster b0576c2155 avm2: Improve the Sound::extract stub 2023-04-03 00:22:23 -07:00
onkrot d047ecb130 avm2: Add X509 certificate classes 2023-04-02 23:59:37 -07:00
renovate[bot] cd3ad90d61 chore(deps): lock file maintenance rust dependencies 2023-04-02 22:00:49 -07:00
renovate[bot] 4eaf1b21e7 chore(deps): update rust crate embed-resource to v2
Co-authored-by: Mike Welsh <mwelsh@gmail.com>
2023-04-02 21:02:33 -07:00
Lord-McSweeney d1b8ec7a7e avm2: Stub Shader 2023-04-02 19:56:14 -07:00
Lord-McSweeney c19031a6fc avm2: Stub ShaderData 2023-04-02 19:56:14 -07:00
Aaron Hill a2fa362091 wgpu: Implement double buffering for Context3D
This matches the Context3D docs. Calling 'present' swaps
the buffers.

I wasn't certain if we actually need a double-buffered depth
texture, but I included one just to be safe.
2023-04-02 19:24:23 -07:00
Aaron Hill 671ebdfa8f wgpu: Execute Context3D commands immediately
Now that most of the complicated Context3D methods have been
implemented, we can simplify the overall design. Instead of queueing
up commands and having `present` execute them in a loop, we
can execute each command immediately. The key insight is that
a `RenderPass` is only needed for `DrawTriangles`, so we don't
have to store it in `Context3D` and deal with complicated lifetime
issues.

The old behavior gave us implicit double-buffering behavior,
since nothing would get rendered until a 'present' call.
Now that a 'drawTriangles' call will immediately submit
a draw command, we need to implement actual double buffering.
This is done in the next commit.
2023-04-02 19:24:23 -07:00
Moulins 9441182b7d avm2: move event dispatch error handling in a single place
The `Avm2::{dispatch, broadcast}_event` methods now log and swallow any
AVM2 error occuring during the dispatch, instead of repeating the
handling code for each caller.

This also introduces some behavioral changes:
- Errors messages are more consistent;
- For consistency with `broadcast_event`, `dispatch_event` panics if
  given a non-event object to dispatch.
2023-04-02 16:52:42 -07:00
Udeshya 34775965ea
avm2: Implement `Transform.pixelBounds` 2023-04-02 23:25:10 +00:00
AllinolCP f0a8e50be1 avm2: implement decodeURI 2023-04-02 14:49:07 -07:00
Tom Schuster 5a18a409f7 avm2: Only reject a single explicit namespace in XML 2023-04-02 16:09:03 -05:00
Toad06 35528913bf core: Make `ExternalInterface` support undefined values 2023-04-02 13:48:14 -07:00
Toad06 5e14aabed6 core: Make `ExternalInterface` support undefined values in browsers 2023-04-02 13:48:14 -07:00
Lord-McSweeney 4777c13528 avm2: ByteArray should have toJSON defined on...
...its prototype.
2023-04-01 17:17:48 -07:00
Lord-McSweeney 58cbc38983 avm2: Use RegExp.valueOf in RegExp.toString
This fixes flag ordering issues
2023-04-01 13:49:41 -07:00
Lord-McSweeney 17ebb8c5bc avm2: Add RegExp.prototype.toString 2023-04-01 13:49:41 -07:00
Lord-McSweeney ab6d5006b4 avm2: Make sure RegExp prototype is not enumerable 2023-04-01 13:49:41 -07:00
Lord-McSweeney 18bff18d0b avm2: Fix QName's prototype 2023-04-01 13:49:41 -07:00
Tom Schuster 86395f194f avm2: Strip BOM in ByteArray::toString 2023-04-01 12:48:22 -07:00
Aaron Hill 7809000170 wgpu: Fix filter texture copy size calculation
I incorrectly changed this in #10373

Fixes #10380
2023-04-01 11:04:55 -05:00
relrelb d9feadce00 web: Run `npm run format`
In order to fix Stylelint's new `media-feature-range-notation` rule:
https://stylelint.io/user-guide/rules/media-feature-range-notation/
2023-04-01 13:11:23 +03:00
relrelb 479926cdba web: Migrate to TypeScript 5.0.0
Work around the newly introduced `--verbatimModuleSyntax` flag:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#verbatimmodulesyntax
2023-04-01 13:11:23 +03:00
renovate[bot] 0e887411cc chore(deps): update node.js dependencies 2023-04-01 13:11:23 +03:00
Daniel Jacobs 4c50e2c271 demo: Add option to reload the current SWF 2023-04-01 01:46:03 -07:00
Aaron Hill 6ce6fd1681 avm2: Use custom_unescape wherever we unescape XML
When we were using a fork of quick-xml, we modified the actual
unescape method. Now that we're using the crates.io release again,
we need to go through our `custom_unescape` function.
2023-04-01 02:25:24 -05:00
renovate[bot] 4fbbf994fe chore(deps): update github actions dependencies 2023-03-31 23:03:07 -07:00
Aaron Hill 18f5ba18e9 core: Don't overwrite font descriptor with a duplicate
If a SWF contains multiple DefineFont tags with the same
font name (but different font IDs), the first tag will win
when a font is looked up by *name*. This affects the behavior
of EditText objects, which can have embedded HTML like
`<font face="MyFontName">` which performs a font lookup by name.

This fixes Fancy Pants World 4 Part 3, which contains two
DefineFont3 tags with the name FancyFont. The second font is
missing many glyphs, so using it causes us to be unable to
render the squiggle and life count text.
2023-03-31 22:47:00 -07:00
Mike Welsh 4c13da8fcb avm2: Unstub `BitmapData.lock` and `BitmapData.unlock`
These functions are intentionally no-ops in Ruffle because it has
no concept of a player dirty region, so unmark them as stubs.

The only observable difference is that Flash Player will sometimes
not re-render a `Bitmap` instance on the stage immediately if it's
`BitmapData` is locked and changed, but this is only temporary and
depends on the redraw behavior of the Flash Player.
2023-03-31 22:13:28 -07:00
Nathan Adams 1c6aaba57a core: Use actual clone() method when cloning bitmap 2023-03-31 21:56:41 -07:00
Nathan Adams 62d30251f2 core: Move clone to bitmapdata operations 2023-03-31 21:56:41 -07:00
Nathan Adams b07bf84da5 core: Skip a gpu->cpu sync in set_pixels_from_byte_array if we're filling the whole bmd 2023-03-31 21:32:15 -07:00
Nathan Adams fcaf462423 core: Fix set_pixels_from_byte_array respecting the bytearray position + tests 2023-03-31 21:32:15 -07:00
Nathan Adams 445912e760 core: Move set_pixels_from_byte_array out from avm2 to bmd operations 2023-03-31 21:32:15 -07:00
Aaron Hill 7f6cb99b08 avm2: Convert QName to ActionScript 2023-03-31 22:05:18 -05:00
Aaron Hill 27092ecb76 avm2: Convert RegExp to ActionScript 2023-03-31 17:08:21 -07:00
Mike Welsh 6fda813f0c tests: Add test for localToGlobal with zero scale object 2023-03-31 16:26:11 -07:00