Commit Graph

1160 Commits

Author SHA1 Message Date
Aaron Hill 5ee6218ab4 avm2: Fix `super_vtable` in `describeType`
This more closely matches what avmplus does.
2023-07-22 17:50:10 -04:00
Abiel Deneke 8f6e9d8f63 avm2: Don't change the length of a fixed output Vector 2023-07-22 16:11:08 -04:00
Nathan Adams 4accc2ca86 tests: Add 'delete list.@*' to the xmllist delete test 2023-07-22 18:24:08 +02:00
Nathan Adams d1cfb1b8d1 avm2: Implement delete_property_local for XMLList 2023-07-22 18:24:08 +02:00
Nathan Adams 4410d666ed avm2: Implement Bitmap.pixelSnapping 2023-07-22 00:34:17 +02:00
Nathan Adams 289f73c85f core: Add pixel snapping (default auto) to Bitmaps, and force it for cacheAsBitmap 2023-07-22 00:34:17 +02:00
Lord-McSweeney 68c5024f21 tests: Add test for LocalConnection.send 2023-07-22 00:00:24 +02:00
Nathan Adams 98ce792a5b avm1: Implement BitmapData.applyFilter() 2023-07-21 21:43:54 +02:00
Aaron Hill f328797d04 avm2: Fix bugs with describeType interfaces and methods
Interfaces should only be listed when calling describeType
with a class instance (not with a `Class` object).

Additionally, AS3 methods can actually be displayed under
some circumstances. This is due to weird legacy behavior
that avmplus implements. A full fix requirs us to implement
namespace versioning, but we can get closer by special-casing
playerglobals (which is special-cased by namespace versioning
anyway).
2023-07-21 15:23:56 -04:00
Nathan Adams f1e96bb1f1 tests: Reduce size of blur_scales_with_screen test 2023-07-20 23:19:20 +02:00
Nathan Adams 67c33ef9c3 core: Disable cacheAsBitmap for swfs that are too large (depending on swf version) 2023-07-20 23:19:20 +02:00
Nathan Adams a85aa41e6a tests: Add displacement filter scaling test 2023-07-20 12:41:30 +02:00
TÖRÖK Attila ad591224f9 tests: Another test with .filters instead of applyFilter 2023-07-20 12:41:30 +02:00
TÖRÖK Attila 4e7baf647e tests: Add another displacement map test 2023-07-20 12:41:30 +02:00
Nathan Adams 400ff32723 wgpu: Implement a naive DisplacementMap filter 2023-07-20 12:41:30 +02:00
Lord-McSweeney dd0d4f7eea avm2: Add test for NetStream.client 2023-07-19 17:26:24 -06:00
Lord-McSweeney 42c1facf55 avm1+tests: Implement onMetaData event for AVM1, fix netStatus test for AVM2 2023-07-19 17:26:24 -06:00
Aaron Hill 715abd8985 avm2: Use invisible mask descendants for mouse picking and rendering
The 'DisplayObject.visible' flag seems to be ignored for mask objects
(and their descendants) - mouse picking still takes them into account,
and they get rendered as part of the mask.

This commit changes display object rendering and AVM2 mouse picking
to ignore DisplayObject.visibility when dealing with mask objects/
descendants.
2023-07-19 23:18:28 +02:00
Nathan Adams b1ba144166 wgpu: Implement Bevel filter 2023-07-19 22:59:33 +02:00
CUB3D 771f568509 core: Trying to access a named shape should resolve to the parent as they have no object representation 2023-07-19 22:32:42 +02:00
sleepycatcoding 4c1c3cc105 avm2+tests: Allow concating XMLLists; add test 2023-07-19 16:03:10 -04:00
Nathan Adams 5597535471 wgpu: Store wgpu::Instance in Descriptors 2023-07-19 21:36:30 +02:00
Nathan Adams 030c3c50e8 wgpu: Make `request_adapter_and_device` take in wgpu::Instance by ref 2023-07-19 21:36:30 +02:00
Nathan Adams 5304009892 tests: Port Shumway's timeline tests over 2023-07-19 17:04:38 +02:00
Lord-McSweeney 5975714f75 avm2+swf+tests: Store metadata on Traits and VTable, report metadata in describeType; parse ABC metadata key-value pairs correctly; add test 2023-07-19 16:24:23 +02:00
Nathan Adams b8081ac609 core: Use actual bounding box of curves instead of an approximation 2023-07-19 02:09:12 +02:00
Nathan Adams aa243dbe4c tests: Port Shumway's acid tests over 2023-07-18 23:48:21 +02:00
Nathan Adams 0076d65865 wgpu: Speed up blur filter by about 50% 2023-07-17 23:33:30 +02:00
nosamu de9ea9571b avm2: Implement SharedObject.size 2023-07-17 00:53:52 +02:00
nosamu fea0df192f avm1: Implement SharedObject.getSize() 2023-07-17 00:53:52 +02:00
MrCheeze e1819f7c00 tests: Add visual test for colored underlines.
Note that the underline's vertical position is wrong, meaning that the
expected.png will have to be updated whenever this is fixed.
2023-07-17 00:32:46 +02:00
Kornelius Rohrschneider a0493c770e core: Implement suggested changes to PR
The suggested changes in the feedback to the pull request have been
implemented.
Therefore, this commit consists of multiple smaller changes:

- The unload_movie method has been renamed to avm1_unload_movie.
- The movieclip_default_state test now doesn't test
  getTextSnapshot().getCount() because the underlying methods haven't
  been implemented in AVM1 yet.
  This should be reverted when they have been implemented or stubbed in
  AVM1.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider bd67ce8661 tests: Add MovieClip state tests
Two tests testing the different states of a MovieClip have been added.

A MovieClip can be in different specific states (namely: default state,
initial loading state, error state, image state, success state and
unloaded state). A state of a MovieClip consists of the values of all
properties and the results of some getter functions of the MovieClip.
To make sure that all of these states are implemented correctly and will
continue to be so in the future, two MovieClip state tests have been
added.

The movieclip_default_state test tests the default state of a MovieClip
after it has been created with createEmptyMovieClip.

The movieclip_state_values test has MovieClips going through all other
states and tests if the values are correct in each.

These tests currently only test the MovieClip states when trying to load
a local file since Ruffle tests currently don’t support tests using
remote URLs. Test cases for remote URLs are still included and can be
used if Ruffle starts supporting remote URLs at some point.

A HelperTest, which can be used to find out about how the state of a
MovieClip changes when trying to load and unload it, has been included
as well.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 8888aae60b tests: Add MovieClip invalid getBounds tests
The behaviour of when the results of getBounds / getRect calls on
MovieClips with invalid bounds are 6710886.35 and when they are
6710886.4 for each corner of the rectangle is rather complex.
To make sure it works correctly in every case and will continue to do so
in the future, eight tests testing the results of getBounds calls under
these circumstances have been added.

This needs to be tested in several tests because an internal state
determining the results can change irreversibly. Making sure that it
changes correctly on different occasions takes several tests.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider a0d0b8e638 core: Refactor & improve NavigatorBackend implementations
All NavigatorBackend implementations have been refactored, resulting in
improved code quality, less duplicated code, more consistent and easier
to understand procedures, additional error handling and better error
messages.

A resolve_url method has been added to the NavigatorBackend trait. It
takes a URL and and resolves it to the actual URL from which a file can
be fetched (including handling of relative links and pre-processing). It
has been implemented in each NavigatorBackend implementation.

Duplicated code has been put into new public functions in
core/src/backend/navigator.rs which are called by all NavigatorBackend
implementations.

ExternalNavigatorBackend:
- The navigate_to_url and fetch methods have been adapted to use
  resolve_url, removing redundant code.
- Error handling has been added in case that the URL can't be converted
  to a PathBuf.
- A TODO about differences between the flash player fetch and the
  Ruffle fetch implementation has been added.

WebNavigatorBackend:
- The previous resolve_url method exclusively to the WebNavigatorBackend
  has been replaced by the new resolve_url method. It is used by
  navigate_to_url and fetch.
- resolve_url now always pre-processes the URL if it's valid (even if no
  base_url exists) and explicitly returns whether the URL can be parsed.
- navigate_to_url now traces an explanatory error each if the URL can't
  be parsed or is local.
- fetch now returns an explanatory error each if the URL can't be parsed
  or is local (previously, a vague "Got JS error" has been returned).

TestNavigatorBackend & NullNavigatorBackend:
- fetch pre-processes the URL now (using the resolve_url implementation).
- If the URL isn't local, an explanatory error is returned (previously,
  it was just an "Invalid URL" error).
- If the URL can't be parsed, an explanatory error with the reason is
  returned (previously, it was just an "Invalid URL" error).

Additionally, error messages in all NavigatorBackend implementations
have been improved and made more consistent, e.g. if a local file can't
be read.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 893052c2a6 core: Add MovieClip error state
A load_error_swf function has been added to the Loader. It makes the
MovieClip enter the error state in which some attributes have certain
error values to signal that no valid file could be loaded. This happens
if no file could be loaded or if the loaded content is no valid
supported content.
The function creates an error state movie stub using the new
SwfMovie::error_movie function (which uses a new default_error_header
function) and configures remaining variables with the
movie_not_available method.
One TODO in order for the error state to be completely implemented has
been added.

Since the error state of the MovieClip includes the final URL of the SWF
file obtained after any redirects, the load_error_swf and
movie_loader_error functions (now) take an swf_url attribute.
To get this URL in case no file could be loaded, the
NavigatorBackend::fetch method has been changed to return an
ErrorResponse struct (including the url and the actual error) in the
error case. The Response struct returned in the success case has been
renamed to SuccessResponse.
All fetch implementations have been adapted accordingly. Code has been
adjusted to return the actual error where that's needed.

Documentation has been added and improved.
2023-07-17 00:08:02 +02:00
MrCheeze 901594b99f
avm2: Do not remove an EditText's selection on unfocus (fix #9006) + implement selectionBegin/selectionEnd/caretIndex (#9067)
* avm2: Do not remove an EditText's selection on unfocus (fix #9006)

There are significant differences between how selection and caret info
work between AVM1 and AVM2.

In AVM1, there is only a single, global selection, which applies to
whichever element is currently focused. Therefore changing the focus
necessarily erases any information of what was selected before. There
can also be no active selection at all.

In AVM2, every text field has its own independent selection info. It is
NOT optional, the default selection is just a caret at position 0. If a
field loses focus, the selection is not rendered, but it is still
present. Movies such as #9006 rely on the same selection still being
there once you give back focus to the field.

Ruffle's model of selections (an Option per text field) is different
from both the AVM1 model (an optional singleton) and the AVM2 model
(mandatory per text field). This fix does not change that, it is only a
narrow fix targeted at 9006.

* avm2: implement selectionBegin/selectionEnd/caretIndex and add a test.

The selection test validates a few situations, including the behaviour
when unfocusing that was fixed in the previous commit.

The test does not validate how the selection changes after replacing
text, as there are still some inaccuracies there.

* avm2: Additional selection fixes needed after merging with master.

1. The default caret for an AVM2 textbox is at the end of the textbox,
   not the beginning.
2. Selection should not be changed when focusing on a textbox in AVM2.
3. Fixed a test whose output.txt didn't actually match the flash player
   output.

* avm2: Make the selection AVM checks compatible with mixed AVM, and revert the on_focus_changed parameters

---------

Co-authored-by: Nathan Adams <dinnerbone@dinnerbone.com>
2023-07-15 16:17:45 +00:00
Nathan Adams 26cf380aa4 avm2: Fix Array.sort(function) 2023-07-15 17:53:05 +02:00
CUB3D e4bd1908bd chore: Fmt 2023-07-15 11:45:02 +02:00
CUB3D 14712b46c6 chore: Fix clippy lint 2023-07-15 11:45:02 +02:00
CUB3D d7a780f5ea core: Fix caching order, add test 2023-07-15 11:45:02 +02:00
Abiel Deneke ae1853f639 tests: Add test for `Matrix3D.transformVectors` 2023-07-14 23:39:39 -04:00
michiel2005 8141e7b54c avm1: fix buttons that were not clickable after a goto 2023-07-14 16:51:07 -06:00
TÖRÖK Attila 49e9376e12 tests/visual: Update avm1/avm2 netstream_play_flv expected images
These changed imperceptibly due to deblocking.
2023-07-14 14:44:23 +02:00
TÖRÖK Attila 39c493ebd5 tests/visual: Disable deblocking for the h263 colorconversion test
Since this functionality was not enabled before, the reference image is
not deblocked. This commit disables deblocking for the test to match the
reference image, and eliminate deblocking as a source of differences.
2023-07-14 14:44:23 +02:00
TÖRÖK Attila f55cbf0a92 tests/visual: Add a basic test for h263 video deblocking 2023-07-14 14:44:23 +02:00
Nathan Adams e0886707c5 tests: Exclude WARP for blur_scales_with_screen 2023-07-12 18:51:11 +02:00
Nathan Adams c3fdfc17dd swf: Scale filter distances where appropriate 2023-07-12 18:51:11 +02:00
Nathan Adams 5c13d323b3 wgpu: Implement the undocumented ability to disable compositeSource for glow/shadow 2023-07-12 18:51:11 +02:00
Nathan Adams 6f98b3d596 wgpu: Saturate alpha in glow shader 2023-07-12 18:51:11 +02:00
Nathan Adams 8cb6e5bdf0 wgpu: Implement drop shadow filter 2023-07-12 18:51:11 +02:00
Nathan Adams aba2394732 wgpu: Respect alpha for glows 2023-07-12 18:51:11 +02:00
Nathan Adams f150a32d86 core: Only scale filters with stage view matrix 2023-07-12 18:51:11 +02:00
Nathan Adams 1aa2ac28c2 wgpu: Slight opimitsation to blur filter by not needing to calculate full_width per fragment 2023-07-12 18:51:11 +02:00
Nathan Adams 30e7a1eac6 core: Account for filter size changes when drawing cacheAsBitmaps 2023-07-12 18:51:11 +02:00
Nathan Adams b30c522f9c wgpu: Implement glow filter 2023-07-12 18:51:11 +02:00
Nathan Adams d4b81cae5c avm1: Migrate XMLNode to NativeObject 2023-07-12 18:33:58 +02:00
Aaron Hill 9d3e96e3a4
render: Implement more Pixelbender opcodes, and fix matrices (#11896) 2023-07-09 16:54:26 +00:00
Adrian Wielgosik b38bd604db avm2: Fix Multiname-with-params formatting 2023-07-08 01:55:44 +02:00
Aaron Hill 61c50e636a
avm2: Convert `has_class_in_chain` to use a `GcCell<Class>` (#11494) 2023-07-07 16:22:38 -04:00
Aaron Hill 4cf0735692 avm2: Implement Utils3D.projectVector and Utils3D.projectVectors 2023-07-06 11:34:40 -04:00
Aaron Hill fb9dbd21b0 tests: Fix stage3d_blend test formatting 2023-07-06 11:18:39 -04:00
Aaron Hill 90dbcfca5d render: Fix writing to varying register in vertex shader 2023-07-06 11:18:39 -04:00
Aaron Hill c295e3e481 avm2: Implement NetConnection.connect with a null `command` 2023-07-06 01:20:34 -04:00
Aaron Hill 009fab1889 core: Expose `LoaderInfo.parameters` and fix other properties
When using a 'Loader', properties on the 'contentLoaderInfo' become
set during specific events in the load sequence. In particular,
'LoaderInfo.bytesTotal' becomes available during the first 'progress'
event.

Also, 'LoaderInfo.parameters' is now properly set from the URL query
parameters. In Flash player, this work even with filesystem urls
(e.g. 'file:///some/path/to/file.txt?paramOne=valOne' will load
a file named 'file.txt', setting and expose the parameter 'paramOne'
with value 'valOne' in `LoaderInfo.parameters`). This required some
cleanup to the desktop and test NavigatorBackend impls to strip
out query parameters when loading a parameter from disk.

Previously, we would set `SwfMovie.parameters` manually from the url.
Now, the various `SwfMovie` constructors automatically extract
query parameters from the provided url. Outside of `SwfMovie`,
we only append *extra* parameters (e.g. those set from `flashvars`).

This makes CPMStar ads work, since the loaded SWF needs to access
`LoaderInfo.parameters`
2023-07-05 19:47:16 -04:00
Aaron Hill 8ac8be7213 avm2: Implement Graphics.drawPath
The 'winding' argument and filling behavior described in the docs
are not yet implemented. However, this implementation is good enough
for Scratch to render its default cat image.
2023-07-05 19:21:50 -04:00
Aaron Hill bbb5619bc9 tests: Add TextField Event.CHANGE test and update test input format 2023-07-05 18:00:59 -04:00
Adrian Wielgosik 87ede6a052 avm2: Set correct `this` values in function calls 2023-07-05 22:36:20 +02:00
Aaron Hill 2d1da4d18e avm2: Throw TypeError when trying to parse malformed XML
Scratch detects if a string is valid XML by trying to construct
an XML object, and catching the thrown error.
2023-07-05 19:41:23 +02:00
Nathan Adams 4fc170e5bd avm1: Implement gradient filters conversions 2023-07-05 19:18:00 +02:00
Nathan Adams bfedfbaa98 avm1: Implement displacement map filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 8a767492e6 avm1: Implement drop shadow filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 40b4f9bafa avm1: Implement glow filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 30027bc03e avm1: Implement convolution filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams df6064b2e9 avm1: Implement color matrix filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams b3629669bd avm1: Implement blur filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 73bc637ad7 avm1: Implement bevel filter conversions 2023-07-05 19:18:00 +02:00
Aaron Hill e716b3fd7f avm2: Implement XML.descendants for attributes
We were previously only ever checking children,
and not attributes.

In order to avoid matching both attributes and elements
with a given name in 'descendants', `E4xNode::matches_name`
now checks `is_attribute` on the provided `Multiname`. This
requries changing several other parts of the codebase to
properly set this flag on `Multinames` provided by ActionScript.
2023-07-04 19:38:30 -04:00
Aaron Hill f7cbe3b7cd avm2: Implement Graphics.copyFrom 2023-07-04 16:12:29 -04:00
Nathan Adams 146d565c02 render: Add Filter::scale() and use it to scale filter values (currently just blur_) 2023-07-03 20:13:40 +02:00
Nathan Adams 4ac13de2f3 wgpu: Switch PASS_SCALES to be accumulative scales, for better calculation of size upfront 2023-07-03 20:13:40 +02:00
Lord-McSweeney 7ad864ca02 avm2+tests: Implement Matrix3D.copyColumnFrom; add a test 2023-07-01 15:23:29 -04:00
Aaron Hill 6e1f00edf2
render: Implement more PixelBender features (#11800) 2023-07-01 13:50:43 -04:00
David Wendt 32524d3abd core: AVM2 display object allocators always ensure both halves of the display object are connected correctly 2023-06-30 16:14:28 -06:00
TÖRÖK Attila c7bbed958c tests: Add test of ScreenVideo FLVs (contributed by torokati44) 2023-06-30 16:14:28 -06:00
David Wendt 21b7e70d09 docs: Keep documentation of the old `num_frames` options until we can remove them 2023-06-30 16:14:28 -06:00
David Wendt 4f4a205637 tests: Add images to the netstream tests 2023-06-30 16:14:28 -06:00
David Wendt 61c269c636 docs: Document `num_ticks` and `tick_rate` 2023-06-30 16:14:28 -06:00
David Wendt 16c9cb4fdd tests: Add option to send ticks to the player instead of calling `run_frame`.
You can also specify a `tick_rate` in order to get ticks faster or slower than the stage frame rate.

We also enable video decode and ticks on the netstream tests, since our netstream impl requires ticks.
2023-06-30 16:14:28 -06:00
David Wendt 4944d81dd7 tests: Update the AVM1 test output to include event data. 2023-06-30 16:14:28 -06:00
David Wendt c00cd0537c tests: Add tests for AVM1 and AVM2 host FLV players. 2023-06-30 16:14:28 -06:00
Fancy2209 8f0a43f9d9
Add prependRotation, copyRowTo and copyRowFrom (#11698)
Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2023-06-30 14:31:08 -04:00
Aaron Hill 9b8a8c9974 avm2: Correctly re-use objects in XML/XMLList call handlers and ctors
`XML(someXMLObj)` and `XMLList(someXMLList)` perform the
normal cast behavior (returning the same object), instead
of creating a new object like other arguments do.

This also applies to `new XMLList(someXMLObj)`
and `XML(singleElemXMLList)`
2023-06-28 21:16:05 -04:00
Nathan Adams 7e96a2fdad wgpu: Blur size is whole kernel width, minus one and half it for the shader 2023-06-28 22:42:31 +02:00
Nathan Adams c0e932422f wgpu: Change blur to 2-pass separable box blur, multiplied by quality 2023-06-28 22:42:31 +02:00
Niv.Kaminer 053bcf9376 core: Update sounds in rootless SWF (close #11666) 2023-06-26 16:59:01 -04:00
Nathan Adams 556ade2fa9 tests: Add ColorMatrixFilter visual test 2023-06-25 21:58:46 +02:00
nosamu 473c40864f tests: Add timeline filters test 2023-06-25 18:27:54 +02:00
Lord-McSweeney 2d02886f5a avm2+tests: Support CData in XML.toXMLString; add test 2023-06-25 00:25:47 -04:00
Lord-McSweeney 494902cf39 tests: Change image for blur filter test 2023-06-24 16:55:40 +02:00
Nathan Adams cdb0774642 core: Hook up DisplayObject::opaque_background 2023-06-24 01:42:04 +02:00
Nathan Adams 9795fc9311 core: Invalidate ancestors on scrollRect changes 2023-06-24 01:42:04 +02:00
Nathan Adams d49a8ce0e6 core: Invalidate cacheAsBitmap when drawing api is used 2023-06-24 01:42:04 +02:00
Nathan Adams cc8edb3bf1 core: Invalidate cacheAsBitmap when various more properties change 2023-06-24 01:42:04 +02:00
Nathan Adams 27db3e70b4 core: Invalidate cacheAsBitmap when transform changes 2023-06-24 01:42:04 +02:00
Nathan Adams 41991da624 core: Invalidate cacheAsBitmap when texts change 2023-06-24 01:42:04 +02:00
Nathan Adams 932291bbad core: Invalidate cacheAsBitmap when morphs change 2023-06-24 01:42:04 +02:00
Nathan Adams 8a3ccdd080 core: Invalidate cacheAsBitmap when graphics change 2023-06-24 01:42:04 +02:00
Nathan Adams c39217e139 core: Invalidate cacheAsBitmap when children are added or removed 2023-06-24 01:42:04 +02:00
Nathan Adams 287e721da8 tests: Add cacheAsBitmap + color transform test, to ensure invalidation when it changes 2023-06-24 01:42:04 +02:00
Niv.Kaminer 69b09ab1ef avm2: Implement Serialization for ByteArrayObject 2023-06-23 08:29:53 -04:00
Aaron Hill 26dfc6ba3e tests: Add BlendMode.MULTIPLY test 2023-06-22 14:23:15 +02:00
Nathan Adams fe48114414 tests: Increased tolerance of stage3d tests 2023-06-21 21:36:17 +02:00
Nathan Adams 6b76af2d40 core: Fix avm2button bounding box 2023-06-20 23:22:53 +02:00
Toad06 22ae6bfec3 avm1: Correct `WaitForFrame` and `WaitForFrame2` actions 2023-06-17 19:23:18 -05:00
Adrian Wielgosik 19b4bfe5d3 avm2: Extend array_concat test with new cases 2023-06-17 22:40:14 +02:00
Adrian Wielgosik 42347d7234 avm2: Extend core_exception tests with new cases 2023-06-17 22:40:14 +02:00
Adrian Wielgosik 6ccb6e7fdd Revert "avm2: Throw TypeError when 'astype' receives a null/undefined class"
This reverts commit ce0ba7795c.
2023-06-17 22:40:14 +02:00
Aaron Hill 69fce3f7f8
wpgu: Initial implementation of PixelBender shader execution (#11441)
* wpgu: Initial implementation of PixelBender shader execution

The implementation is split across four crates:
* `ruffle_render` now holds the main PixelBender bytecode parsing
   implementation (previously, this was in `ruffle_core`).
* `ruffle_core` holds some helper functions for converting between
   AVM2 `Value`s and the PixelBender vector types.
* `naga-pixelbender` (newly created) constructs a Naga `Module`
  from parsed PixelBender bytecode
* `ruffle_render_wgpu` sets up the render pipeline for the shader
  constructed by `naga-pixelbender`, and actually executes the shader.

The Actionscript-side shader parameters are passed in through uniforms.
This allows us to cache the compiled `naga::Module` and associated
wgpu types inside `ShaderData`, when it's first created. Each invocation
of a `ShaderJob` only needs to create a bind group and render pass.

Limitations:

* Only a few of the PixelBender opcodes are implemented - however, this is
enough to get Stemlands cannon rotation working, as well as a cool
"donut" shader that I found and included as a test.
* PixelBender matrix types are not supported.
* Only BitmapData is supported as an input/output type - Flash Player
  also supports using Vector and ByteArray
* ShaderJob execution is always synchronous.

* Adjust comments

* Address review comments
2023-06-15 22:50:24 +00:00
Aaron Hill f257979b86 avm2: Use a separate domain for playerglobals
We create a separate child domain, which is accessible
from the Stage and the root movieclip.

This prevents ActionScript from loading classes into the
special playerglobals domain (Domain.parentDomain is modified
to return null instead of the playerglobals domain when applicable),
so the native method lookup logic will never run for user code.
2023-06-15 12:57:39 -05:00
Aaron Hill 87850abd19 avm2: Improve support for deleting XML attributes and children
We now support deleting named children, as well as attributes.
Additionally, I've fixed our handling of `XML.parent()` - we now
properly set the parent when a child is created, and clear the parent
when `delete` is used.
2023-06-15 09:02:09 -05:00
Aaron Hill cd2c7f6f2f tests: Enable tracing_subscriber in tests
Previously, we weren't displaying any Ruffle logs when running tests.
2023-06-14 17:15:31 -05:00
AllinolCP e4d86ec9e7
core: implement screen resolution for capabilities (#11156) 2023-06-14 20:49:13 +00:00
Lord-McSweeney 6006aa82c2 avm2+tests: Support primitives besides null in MovieClip.addFrameScript; add test 2023-06-14 18:16:39 +02:00
Lord-McSweeney f5528aab75 avm2+tests: Implement Object.length and Object.init; add test for Object.length 2023-06-14 12:37:00 +02:00
Adrian Wielgosik 128416cccd avm2: Support Array(...) without new 2023-06-14 00:34:13 +02:00
Aaron Hill 40318f905e avm2: Implement call handler for XMLList
This delegates to the XMLList constructor, just as
the XML call handler delegates to the XML constructor.
2023-06-13 17:20:11 -05:00
Mike Welsh c4e4eba63f avm2: Implement BitmapData.setVector 2023-06-12 18:34:51 -05:00
Aaron Hill a006e96a44 avm2: Set named field in parent to null when child is removed
If a child named 'foo' is removed by the timeline (without
having been previous added/removed from the timeline by ActionScript),
then the 'foo' field in the parent will be set to null. This occurs
even if the 'foo' field in the parent is not currently set to
the child 'foo' (e.g. 'this.foo = someOtherObject' was executed by
ActionScript).
2023-06-12 17:33:02 -05:00
Aaron Hill bb53af36a5 avm2: Add ignored test for subclass with 'overriding' field name
The Adobe Animate compiler rejects a subclass that contains
a non-private field with the same name as a field in an ancestor
class (e.g. 'pub var foo:String' in both the subclass and superclass).

Unfortunately, Flash Player accepts this code, and creates a distinct
field for each class (even though they have the same namespace and
name). I suspect that this is caused by the optimizer replacing the
field accesses with internal slot accesses.

I've added an ignored test demonstrating this behavior - getting Ruffle
to reproduce it will be tricky.
2023-06-12 15:16:10 -05:00
Aaron Hill ce0ba7795c avm2: Throw TypeError when 'astype' receives a null/undefined class 2023-06-12 02:31:03 -05:00
Lord-McSweeney 4d8feeab2e avm2+tests: Fix String.substr with negative second value, add tests 2023-06-10 15:48:45 -05:00
Aaron Hill cfb23d1f97 avm2: Implement AMF serialization of XML objects 2023-06-10 12:13:07 -05:00
Nathan Adams 38a3f67000 avm1: Don't create _levelN for unloadMovieNum(N) 2023-06-10 10:37:15 +02:00
AllinolCP 44ff49aa53
core: Fix status code implementation for AVM1 and implement HTTPStatusEvent.HTTP_STATUS for avm2 (#11360) 2023-06-10 03:06:26 +00:00
Toad06 2894f01d50 avm1: Implement `MovieClip.lineGradientStyle` 2023-06-09 17:36:34 +02:00
Toad06 181aac46b0 avm1: Don't fail if base clip is invalid in `GetProperty`/`SetProperty` 2023-06-09 16:59:27 +02:00
Aaron Hill 59b219cda6 avm2: Run 'nested goto frame' for entire Stage and orphans
When we run a 'goto', a weird "nested frame" gets triggered.
Previously, we were only calling `construct_frame` on the target
MovieClip as part of this "nested frame". However, Flash Player
seems to treat this (in some ways) like a normal frame - *all*
objects on the Stage (and orphans) have `construct_frame` called.

In particular, `gotoAndStop`/`gotoAndPlay` is called during
an "enterFrame" event handler, then unrelated objects on the Stage
will have their children constructed during the execution of
`gotoAndStop`/`gotoAndPlay`. The same logic holds for frame scripts.

This fixes a bug in Steamlands, which relies on children on the main
timeline being constructed immediately following a call to `gotoAndStop`
on an orphan (originally triggered from an "enterFrame" handler).
2023-06-08 22:17:27 -05:00
Toad06 8ce8b775a7 avm1: Fix coercion order in SWFv4 actions 2023-06-08 01:33:08 +02:00
Moulins b71b8f9de5 avm1: fix coercions for the `blendMode` property of display objects
`mc.blendMode = 3` is a valid way of modifying the blend mode of a DO;
on the other hand, booleans and objects *shouldn't* be coerced.
2023-06-08 01:18:06 +02:00
Aaron Hill 0e0399963e avm2: Throw exception when ExternalInterface is not available 2023-06-07 17:24:25 -05:00
Aaron Hill d2999a2572 core: Fix parsing of PixelBender sampleNearest and sampleLinear
This fixes a panic on startup for Sniper Team
2023-06-07 15:59:31 -05:00
Aaron Hill 5fd7dc2c9b core: Correctly handle '.' and '<' in obfuscated QNames
QName can contain characters like '.' and '<' as part of the
package or class name (though this requires editing the SWF
or using a nonstandard compiler). This broke our attempt to parse
generic type paramters by looking for '.<'

Instead, our 'Vector' special casing now operates on the unparsed
'AVMString' name, instead of attempting to construct a 'QName'.
This means that we don't need to handle generic paramters at
all for obfuscated names (which will never start with '__AS3__'
or 'Vector.<')

This fixes a bug in Red Ball 4v3, which has an obfuscated class
'!D.<H'
2023-06-06 18:12:58 -05:00
Aaron Hill 0d5ead4c02 core: Ignore newer PlaceObject tag in same frame with duplicate depth
If we have two PlaceObject tags in the same frame with the same depth,
only the first one actually places an object. The second one is ignored
(Flash Player logs a warning).
2023-06-06 14:50:07 -05:00
Nathan Adams 10134467c9 avm2: Don't error on removeChildren() for empty containers - fixes #11382 2023-06-05 18:30:08 -05:00
Aaron Hill 2cd518013c
wgpu: Don't skip alpha/erase blend modes for BitmapData.draw (#11323)
We can skip these when we're drawing to a fresh buffer, but not when we're blending over an existing BitmapData texture.
2023-06-02 21:16:05 +00:00
Aaron Hill 21429cc205 avm2: Add PixelBender bytecode parsing to ShaderData
We now parse PixelBender bytecode, and populate the parameters
from the bytecode on `ShaderData`. This is enough to progress
Steamlands, which needs to access dynamically set properties
on `ShaderData`

Bytecode execution is not implemented yet.
2023-06-02 15:23:32 -05:00
Aaron Hill 999e2f5b71 wgpu: Implement Context3D.setScissorRectangle 2023-06-02 14:56:14 -05:00
relrelb abb0e33431 chore: Use Rust's `OnceCell`/`OnceLock`
They were stabilized in Rust 1.70.0, which was released yesterday.
This removes the `once_cell` dependency.
2023-06-02 22:21:38 +03:00
Aaron Hill 8b257ef6da avm2: Always run `construct_frame` in `initialize_for_allocator`
When we create a DisplayObject from ActionScript, we should always
run `construct_frame` on it, regardless of what frame phase we
are currently in.

This fixes a regression in Fancy Pants World 4 Part 1, where entering
the first door produced an error.
2023-05-31 17:33:25 -05:00
relrelb df1cd29a12 tests: Expand `duplicate_movie_clip` 2023-05-30 23:10:36 +03:00
Aaron Hill d18df2d3f1 tests: Add non-power-of-2 texture test 2023-05-28 23:35:53 -05:00
Aaron Hill 0955ab40e6 avm2: Fix rounding behavior in BitmapData rectangle operations
Flash Player performs `x + width` and `y + height` as floating
point operations before `round_to_even`. This affects the extent
covered by a `Rectangle` in various BitmapData methods, as the sum
of two values might be large enough to be rounded up to a larger
value (when rounding `x` and `width` individually would have
produced a smaller overall extent).
2023-05-28 18:46:55 -05:00
Aaron Hill 3f93abffd5 avm2: Allow replacing and deleting XML attributes 2023-05-28 15:52:57 -05:00
Aaron Hill 14c6d1d959 avm2: Implement URLRequest.requestHeaders
These are directly set on the underlying navigator's HTTP
request type, and get printed out in our test navigator backend.

No validation of the header names is performed - on web, this will be
enforced by the browser.
2023-05-28 12:07:37 -05:00
Nathan Adams aeb089ac0f avm2: Move DisplayObject assignment into an initializer 2023-05-26 22:06:20 -05:00
Aaron Hill cf4ca543bd core: Use clone-on-write behavior for render list iteration
When we iterate over a render list (in order to call
`enter_frame`, `construct_frame, etc.) we need to be sure
that we iterate over all of the original `DisplayObjects`
in the list, even if the list is modified during iteration
(e.g. some ActionScript code calls `parent.addChildAt`).

Previously, `RenderIter` would repeatedly call `child_by_index`
on the original `DisplayObjectContainer`, up to the original
child count. If new DisplayObjects were inserted into the list
during iteration, we could miss some of the original DisplayObjects
in the list (as they are now at a greater position in the list).

To solve this, we now store the render list as an `Rc<Vec>`,
and use `Rc::make_mut` to modify it. See the comments
for more details.
2023-05-26 21:42:06 -05:00
Aaron Hill e98ff6a6d7 avm2: Add legacy handling for configureBackBuffer with SWF version < 30
With SWF version < 30, Context3D.configureBackBuffer throws
an error with a less informative message when the width/height
are out of range. Additionally, it seems to special case
the case width=0, height=0, antiAlias=0. enableDepthAndStencil=false,
and does *not* throw an error. This is relied on by Sniper Team.
2023-05-24 18:15:30 -05:00
Nathan Adams b9322ba93a desktop: Render game separately to UI, blit both onto surface 2023-05-24 23:50:48 +02:00
iwannabethedev 1e0714aaa1 core: Fix serialization of arrays with dynamic properties. 2023-05-23 19:46:24 -05:00
Aaron Hill 358beabf5a avm2: Add Matrix3D.[recompose,decompose,copyColumnTo,invert,determinant]
The Flash Player 'Matrix3D.recompose' method throws exceptions under
certain circumstances with the "quaternion" orientation style.
I haven't yet figured this out yet, so I've marked that case as a stub.

All of the implementations are based on the OpenFL code, with some
tweaks to match Flash Player's behavior.
2023-05-23 18:51:46 -05:00
Aaron Hill c53a903d35 avm2: Suppress events for selectable was_static TextFields
TextFields have a very unusual behavior - if they are selectable
and have `was_static`, they *block* the dispatch of mouse events when
they're targeted (not even the Stage will receive the event).
This only occurs when the TextField is actually targeted
(which requires mouseEnabled=true). With mouseEnabled=false,
the event will be dispatched with an ancestor as the target,
following the usual logic.

Also, TextFields now properly propagate mouse picks to
their parent if mouseEnabled=false. Previously, setting
mouseEnabled=false for a TextField made all mouse picks
cause a miss on it. This was the cause of the Turbo Kids
regression.

Fixes #10245
2023-05-23 17:57:06 -05:00
Nathan Adams afa78ebdfe avm1: Correctly send onUnload events for movies unloaded with GetURL2 - fixes #2422 2023-05-22 23:41:41 +02:00
Aaron Hill ace87861ce avm2: Make ByteArray.readMultiByte cut string off at null byte
We already had this behavior in `readUTF` and `readUTFBytes`,
but we need it in `readMultiByte` as well.
2023-05-22 16:01:50 -05:00
Aaron Hill b94f9f3043 avm2: Coerce function return value to declared return type
This can actually affect runtime behavior - if the return type is
declared as 'int', then an instance of a custom class will get
coerced to 0 when returned by the function.
'Plants vs Zombies Demo' relies on this - it has a function which
incorrectly returns an object instead of an array index, but the
value gets silently coerced to 0 under Flash Player.
2023-05-22 13:47:32 -05:00
iwannabethedev 18ea71959b tests: Add test for XML/XMLList hasSimpleContent/hasComplexContent 2023-05-22 06:17:37 -05:00
Aaron Hill 6ac4e5256d avm2: Check parent domain in export_class
The `export_class` function mirrors `export_definition`, and needs
to avoid exporting something already defined in a parent domain.
2023-05-21 17:37:54 -05:00
Aaron Hill 95b0b29310 avm2: Initial implementation of URLStream
This is based on URLLoader, and doesn't actualy 'stream' data -
it all becomes available once the request finishes. However, this
is good enough to get Sniper Team working.
2023-05-21 15:00:08 +02:00
TÖRÖK Attila 65117499fd chore: Bump regress and toml dependencies 2023-05-21 14:42:01 +02:00
TÖRÖK Attila e54f3fef8a tests: Make the audio backend tick every frame in the runner 2023-05-21 09:50:07 +02:00
iwannabethedev 7b12cb882f core: Fix error message in 'pixelDissolve()'. 2023-05-21 01:47:06 +02:00
iwannabethedev e74a543ebb core: Add visual test for 'pixelDissolve()' for AVM1. 2023-05-21 01:47:06 +02:00
iwannabethedev 9fa79a187e core: Fix wrong test print in test. 2023-05-21 01:47:06 +02:00
iwannabethedev 6f98d39c25 core: Implement 'pixelDissolve()' for AVM1. 2023-05-21 01:47:06 +02:00
iwannabethedev 1bd9f82496 core: Implements `BitmapData.pixelDissolve()` for AVM2.
The changes have automated tests for them.

The implementation has not been implemented or tested for AVM1 yet.
2023-05-21 01:47:06 +02:00
Aaron Hill ad77cb0209 core: Refactor Loader to properly load images
We now run all of the completion logic (including adding
the new DisplayObject as a child) in `Loader::movie_loader_complete`.
Previously, some of this logic was run from `Loader::preload_tick`,
which meant that loaded images did not have the logic run.

Also, `BitmapData` and `Bitmap` instances (with corresponding AVM2
objects) are now properly constructed for loaded images.
2023-05-20 18:35:10 -05:00
Toad06 b88e19ef6c avm1: Filter buttons that use a `keyPress` event 2023-05-21 01:13:26 +02:00
Aaron Hill 5d62ef90f2 wgpu: Use intermediate buffer for Context3DCommand::CopyBitmapToTexture
In a previous PR, I introduced an optimization that used
`copy_texture_to_texture` to copy directly from a BitmapData GPU
texture to a Stage3D GPU texture.

Unfortunately, this optimization is incorrect. A BitmapData GPU
texture can be modified at any time by normal AVM2 code - in
particular, in might be modified before we submit the encoded
`copy_texture_to_texture` command. This shows up in Sniper Team,
which re-uses BitmapData objects for multiple distinct textures.
The previous 'optimization' resulted in the wrong BitmapData contents
getting uploaded to a texture (since it was changed before the copy
command was submitted).
2023-05-20 17:38:26 -05:00
TÖRÖK Attila fa90ea9cc2 tests/visual: Save color and alpha difference in separate images
So the whole thing isn't invisible if the alpha channels matches.
Also only save the alpha difference if there is any.
2023-05-20 23:41:56 +02:00
TÖRÖK Attila 3d0b8cc849 tests/visual: Save actual image even if size is wrong
This should help with creating the initial expected image
when making new tests.
2023-05-20 23:41:56 +02:00
Aaron Hill 0864853d44 avm2: Allow passing `null` to `Context3D.setProgram`
This clears the vertex and fragment shader programs
(bringing the Context3D back to its initial state).
2023-05-20 16:23:03 -05:00
Tom Schuster 2493194d2f tests: Test XMLList set 2023-05-19 20:10:47 -05:00
Aaron Hill 6025878aab avm2: Respect SKIP_INVISIBLE for DisplayObject
Previously, we allowed mouse picks of certain invisible
DisplayObjects, even when HitTestOptions::SKIP_INVISIBLE
was set.
2023-05-19 08:12:00 -05:00
Aaron Hill 7619594b1c agal: Implement Float1 to vec4f conversion 2023-05-18 16:12:22 -05:00
Aaron Hill 7004e98b23 avm2: Don't validate Context3DVertexBufferFormat when buffer is null
This matches Flash Player's behavior - some SWFS try to pass in 'null'
for both the buffer and format.
2023-05-18 15:14:29 -05:00
Aaron Hill 75569e1311 avm2: Throw error for invalid Stage3D back buffer size 2023-05-16 17:36:22 -05:00
Aaron Hill bd2be88711 wgpu: Fix MSAA and depth buffer handling in SetRenderToTexture
When multisampling is enabled, we should create a new multisampled texture,
and use the existing texture as the resolve buffer. We also need to
call `update_has_depth_texture` to keep our pipeline aware of whether
or not we currently have a depth buffer attached.

Makes progress on #10641 (it has a stack overflow after
this PR, due to an unrelated issue).
2023-05-15 09:34:30 -05:00
iwannabethedev c86aed35a2 tests/core: Add test for BitmapData.draw() with ColorTransform. 2023-05-15 00:51:54 +02:00
Aaron Hill 729d5a2c65 avm2: Don't overwrite existing entry in `export_class`
This makes the behavior consistent with `export_definition`
2023-05-13 11:15:54 +03:00
Aaron Hill 3c6820c6e1 avm2: Check length and copy vector in Matrix3D constructor 2023-05-13 11:00:31 +03:00
iwannabethedev 93450b28b0 avm2: Add 'static length' for most types. 2023-05-11 22:16:55 +02:00
Aaron Hill e488cc9f7a wgpu: Allow unaligned writes to IndexBuffer3D
wgpu requires buffer copy sizes and offsets to be 4-byte aligned.
Unfortunately, ActionScript can perform 2-byte aligned uploads
into an IndexBuffer3D.

To support this, we now keep a copy of the IndexBuffer3D on the CPU.
When performing an upload to the buffer, we round the offset down
and the size up to the nearest 4-byte aligned value. The cpu buffer
is used to fill out the write with existing data, so that we don't
corrupt the contents of the GPU buffer.

To avoid introducing a new RefCell, I've changed IndexBuffer3D
to use a `Box` instead of an `Rc` to store the trait object.
This allows us to pass a mutable reference down to the backend.
2023-05-10 18:20:29 -05:00
Huw Pritchard b79b192a58 avm2: Implement PrintJobOptions 2023-05-09 20:51:44 -05:00
Aaron Hill 1908d85f65 avm2: Initialize `Object` instance vtable before other classes
Early class construction is tricky - `Object` defines properties
that need to get copied into subclass instance vtables, but `Class`
defines `prototype`, which needs to be copied into the *class* vtable
of `Object`.

To accomplish this, I've split out instance vtable initialization
into a separate `init_instance_vtable`. We call
`object_class.init_instance_vtable` before
`class_class.init_instance_vtable`, but do things in the opposite
order for `into_finished_class` (`class_class.into_finished_class` is
called before `object_class.into_finished_class`)
2023-05-07 07:46:30 -05:00
iwannabethedev 724df48186 avm2: Add AS 'length()' to XML. 2023-05-06 12:02:06 -05:00
friedkeenan 8d96626026 avm2: Add test for ApplicationDomain::getQualifiedDefinitionNames 2023-05-04 19:51:04 -05:00
Tom Schuster f6c0685992 avm2: Allow setting XML methods as properties 2023-05-04 19:34:14 -05:00
Toad06 ee7403952a avm1: Allow `button.enabled` to hold any value 2023-04-30 21:08:27 +03:00
Toad06 86c27078d3 avm1: `button.enabled = undefined` doesn't disable the button 2023-04-30 21:08:27 +03:00
Tom Schuster 69134d7d8d tests: Test XML.hasOwnProperty 2023-04-29 16:34:10 -05:00
relrelb 81dcc66c01 tests: Expand `as_broadcaster`
Verify that `AsBroadcaster` is actually a usable constructor.
2023-04-26 21:21:57 +03:00
Nathan Adams cc731a78ee avm2: Respect data, method and contentType in Loader.load() 2023-04-26 12:46:23 +02:00
Lord-McSweeney f412f62127 avm2/tests: use try_get_object in JSON/Add test for undefined receiver 2023-04-26 00:17:44 +02:00
Lord-McSweeney 58212ec280 avm2: Throw AVM errors for JSON operations (and add tests) 2023-04-26 00:17:44 +02:00
Aaron Hill 6eba8d07ee avm2: Implement MorphShape class and use it for MorphShape displayobject 2023-04-25 18:43:43 +02:00
Toad06 ad4dc943fa avm1: Fix some issues with buttons 2023-04-25 17:50:25 +02:00
Aaron Hill 4432c45eb3 avm2: Mark 'callee' property as non-enumerable on 'arguments' array
Some SWFs iterate over the 'arguments' array, and the 'callee' property
should not get enumerated.
2023-04-25 17:29:20 +02:00
relrelb ff7c458739 core: Accept borrowed strings in `NavigatorBackend::navigate_to_url`
This avoids some unnecessary clones.
2023-04-24 22:06:47 +03:00
Tom Schuster 8b3491fe53 tests: Update the XML abstract equality test 2023-04-23 22:07:54 -05:00
Aaron Hill 15af946cf1 avm2: Stop after first frame when movieclip doesn't extend MovieClip
It's possible to have a DefineSprite tag with multiple frames,
but with a corresponding SymbolClass that directly extends
`Sprite` (and therefore does *not* extend `MovieClip`). When this
happens, Flash Player stops after the first frame.
2023-04-23 16:48:38 -05:00
Aaron Hill 33e9713279 avm2: Fix get_super and set_super with normal methods
Doing `super.someNonGetter` gives you back a function object.
We were previously attempting to call normal methods as though
they were getters. Additionally, we were failing to properly
get the property from the superclass vtable.
2023-04-23 16:28:59 -05:00
Nathan Adams 4f4327b152 wgpu: Fix drawing a transparent bitmap with MSAA 2023-04-18 23:15:42 +02:00
Tom Schuster da689b7687 tests: Test XMLList.child 2023-04-11 14:49:32 -04:00
Nathan Adams 35f3a21110 core: Fix bitmapdata.floodFill() replacing X with X + test. Fixes #10642 2023-04-11 10:40:57 -04:00
Mike Welsh 89e9b15c60 tests: Improve test for `Graphics.beginBitmapFill` 2023-04-11 11:36:49 +02:00
Toad06 81d907b9f0 tests: `MovieClip.focusEnabled` in avm1 2023-04-09 14:11:24 -07:00
Tom Schuster 5289009959 tests: Add some tests for XML abstract equality 2023-04-09 12:02:20 -07:00
Mike Welsh 6ad5c30188 tests: Test for correct variables in `loadvariables_method` test 2023-04-08 13:37:25 -07:00
Mike Welsh 35810a8c7e tests: Add `log_fetch` option
Adds a `TestNavigatorBackend` that has the ability to log HTTP
requests for tests.
2023-04-08 13:37:25 -07:00
Mike Welsh a38f74d989 tests: Add `NavigatorTestBackend` 2023-04-08 13:37:25 -07:00
Tom Schuster d9e69563d3 avm2: Implement XMLList.copy 2023-04-07 12:29:49 -05:00
Udeshya 54a8672390
avm2: Trim xml text nodes when being parsed (#10341) 2023-04-06 22:41:46 -05:00
Aaron Hill 962cf92223 avm2: Implement Context3D.setSamplerStateAt
This fixes pixelated backgrounds in Fancy Pants World 4 Part 3
2023-04-05 16:44:07 -07:00
Toad06 5e165a0682 avm1: Fix some issues with `Selection.getFocus()` and `setFocus()` 2023-04-05 15:53:18 -07:00
Mike Welsh 83aff3c7ba tests: Add Julia fractal Stage3D test 2023-04-05 12:22:13 -07:00
Mike Welsh de80de731d tests: Add test for scrollRect within masker 2023-04-04 13:10:45 -07:00
Mike Welsh e21f3744b5 tests: Add visual test for TextField as mask 2023-04-04 13:10:45 -07:00
Nathan Adams 06bc4e1403 wgpu: Fix sync issue introduced in #9753 and added test 2023-04-04 11:11:57 -07:00
Mike Welsh 63aa67d196 tests: Add test for `Matrix3D.transformVector` and `deltaTransformVector` 2023-04-03 17:09:16 -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
Tom Schuster 86395f194f avm2: Strip BOM in ByteArray::toString 2023-04-01 12:48:22 -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
Nathan Adams fcaf462423 core: Fix set_pixels_from_byte_array respecting the bytearray position + tests 2023-03-31 21:32:15 -07:00
Mike Welsh 6fda813f0c tests: Add test for localToGlobal with zero scale object 2023-03-31 16:26:11 -07:00
Mike Welsh c7387eace4 tests: Add tests for hitTesting zero scale graphics 2023-03-31 16:26:11 -07:00
Nathan Adams 94e5aa8f34 core: Fix calculating dirty area of BitmapData.draw() with rotation 2023-03-31 16:57:52 +02:00
Nathan Adams f0ebefd624 tests: Add bitmapdata recursive draw test 2023-03-31 16:57:52 +02:00
Nathan Adams 78f9bb13d6 render: Fix PixelRegion::for_region_i32 for negative coordinates 2023-03-31 16:57:52 +02:00
Nathan Adams e614265c17 core: Move fill_rect from BitmapData to bitmap_data_operations, fixed a bug when using non-standard values, and added better tests for fill_rect showing the bug 2023-03-31 16:57:52 +02:00
Toad06 fea8e8c90a tests: `MovieClip.setMask` in avm1 2023-03-31 02:39:39 -07:00
Tom Schuster ce4ddee792 avm2: Shim flash.xml.XMLNode using XML 2023-03-31 00:11:52 -07:00
onkrot 5632ade09c avm2: Hookup `DisplayObject.opaqueBackground` 2023-03-29 23:11:01 -07:00
Tom Schuster d16a8726c9 tests: Add test for XML.childIndex 2023-03-29 14:40:29 -05:00
Tom Schuster bbf4363395 tests: Add test for XML.copy 2023-03-29 11:04:32 -05:00
Nathan Adams 42e23ce100 tests: Add tests for LoaderInfo properties that error 2023-03-28 11:57:00 +02:00
Adrian Wielgosik 4e84632609 avm2: Fix edge cases in RegExp constructor 2023-03-27 19:09:09 -05:00
Mike Welsh 87dad709b8 tests: Add test for `SharedObject.clear` 2023-03-26 22:22:27 -05:00