Commit Graph

731 Commits

Author SHA1 Message Date
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
Aaron Hill 1f22f868a0 tests: Use antiAlias=4 in Stage3D tests
This is the only antialiasing level supported by Mesa lavapipe,
which we use to run our tests on CI.
2023-03-26 18:05:41 -07:00
Aaron Hill a52cb7461e wgpu: Implement MSAA support for Stage3D
When we receieve a nonzero 'antiAlias' parameter, we create
create a non-multisampled resolve buffer to use with WGPU.

Several tests were already requesting antialiasing, so their
output images are now anti-aliased without any changes to
the tests themselves.
2023-03-26 18:05:41 -07:00
Aaron Hill da6384b30e Warn instead of panicking 2023-03-26 17:22:52 -07:00
Aaron Hill 7f829dd646 avm2: Don't overwrite symbol class entry with a different SwfMovie
If you use a `Loader` to load an SWF containing a class that shadows
an already-defined class, the class definition from the Loader SWF
will be ignoredin favor of the already-defined class. This commit
applies this log to symbol classes as well - the symbol registry for the class
should continue to point to the existing MovieClip in the parent.
This results in the child SWF instantiating the class from the parent
SWF when the child places the affected movie clip on the timeline.

This fixes a bug in Fancy Pants World 4 Part 3, where the sub-level
SWF was replacing the symbol class entry for the parent 'shipInteract'
class with the dummy clip provided in the sub-level SWF (instead
of continuing to use the correct clip from the parent SWF).
2023-03-26 17:22:52 -07:00
yoganlava da0b245fb8 avm2: Fully implement XML.elements() 2023-03-25 23:12:51 -07:00
EmperorBale 8bb4f21065 avm2: Add test for function double borrow issue 2023-03-25 21:57:04 -07:00
Tom Schuster 53d9118834 avm2: Implement XML set for simple element cases 2023-03-25 20:40:44 -07:00
Aaron Hill b140029e95 render: Fix BitmapData.applyFilter with non-full sourceRect
Previously, we were scaling down the source image to fit into
the smaller sourceRect, instead of cropping at the original scale.
This broke the background textures in Fancy Pants World 4 Part 2,
as the scaled-down output image resulted in a smaller rectangle
being returned from 'getColorBoundsRect'

We now crop the image by properly constructing the UV-coordinate
transformation matrix. We were also using the wrong value for the
'destPoint' y coordinate, which I fixed.

This slightly changes the image output of two tests - the new images
now more closely match the Flash output.
2023-03-25 18:44:01 -07:00
Moulins 5b4096de8b wstr: Revert incorrect optimization in hash calculation
Calling `Hash::write_bytes` isn't guaranteed to be equivalent to a
sequence of `Hash::write_u8`.

Additionally, make sure the hash is truly prefix-free by hashing the
length first.
2023-03-25 18:27:51 -07:00
relrelb 39b53c76d6 ci: Deny warnings on Web
As suggested in https://github.com/ruffle-rs/ruffle/pull/6935#pullrequestreview-967181111.
2023-03-24 19:16:32 -07:00
Mike Welsh 1726d24098 tests: Add tests for calling undefined AVM2 function 2023-03-24 18:21:32 -07:00
Toad06 4161050db5 tests: `XML.getBytesLoaded` and `XML.getBytesTotal` in avm1` 2023-03-22 17:51:42 -07:00
Mike Welsh 44c9e3073c tests: Test full TypeError message in removeChild test 2023-03-22 17:13:36 -07:00
Adrian Wielgosik d77cf83e07 avm2: Fix si8/si16 opcodes 2023-03-22 22:55:43 +01:00
Nathan Adams edbdf224ae avm2: Skip BOM when reading utf8 from ByteArrays 2023-03-21 12:20:43 +01:00
Toad06 911982eb7d tests: Test MovieClip methods for loaded images 2023-03-20 01:36:04 +01:00
Huw Pritchard 645ff76bcd
avm2: Add 11 AS3 classes (#10003) 2023-03-20 00:19:31 +00:00
AllinolCP b69af5d70a tests: add tests for XML.parent() 2023-03-19 16:06:01 -07:00
Nathan Adams 078672782c wgpu: Skip Alpha/Erase blends with no parent Layer 2023-03-19 14:59:48 -07:00
Mike Welsh e76154009c tests: Add image tests for BitmapData.colorTransform 2023-03-19 09:59:13 +01:00
Nathan Adams ea424f3d1e avm2: Fix panic when constructing custom BitmapData from timeline 2023-03-19 07:47:40 +01:00
Nathan Adams ae25ace3f6 tests: Recreated edittext tests 2023-03-19 06:55:07 +01:00
Nathan Adams 909a399911 tests: Add visual test for font selection 2023-03-19 06:55:07 +01:00
Mike Welsh dfeba5330e tests: Add AVM1 BitmapData.hitTest test 2023-03-18 19:47:39 -07:00
Mike Welsh b173176fee tests: Add test for #9885
A simpliied test case to test the #9885, where a hang occurred when
a button is removed while executing code in a v5 SWF.
2023-03-18 19:25:16 -07:00
Nathan Adams 1004f3fee9 tests: Add a test for a shape with HAS_FILL_WINDING_RULE 2023-03-18 19:14:08 -07:00
Nathan Adams dc17f7dc30 tests: Add a test for rendering a self-intersecting glyph 2023-03-18 19:14:08 -07:00
Tom Schuster e9e342fe23 avm2: Implement String call handler 2023-03-18 17:51:22 -07:00
Tom Schuster 5aac938e86 avm2: Implement XMLList.text() 2023-03-18 12:18:24 -07:00