Commit Graph

884 Commits

Author SHA1 Message Date
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