Commit Graph

5567 Commits

Author SHA1 Message Date
Ray Redondo 40d53cda59 avm2: make BitmapData and DisplayObject impl IBitmapDrawable 2021-09-11 15:47:20 -07:00
Ray Redondo 7f895473cb avm2: IBitmapDrawable stub 2021-09-11 15:47:20 -07:00
Daniel Jacobs 2213e7d012 web: Menu embed/object attribute true value is case-insensitive 2021-09-11 14:25:52 -07:00
David Wendt 1e0d259075 avm2: Allow nulling `Bitmap.bitmapData`.
One of the two tests in this PR relies upon the backend storing bitmap data, but the test rendering backend does not yet do this.
2021-09-11 12:11:35 -07:00
David Wendt bfb6f03d62 avm2: Impl `Bitmap.smoothing`
Also, `smoothing` should be set at construction time even if we're setting up a timeline bitmap.
2021-09-11 12:11:35 -07:00
David Wendt 2ba0e12b7e avm2: Stub `Bitmap.pixelSmoothing` 2021-09-11 12:11:35 -07:00
David Wendt 8ae669b96c avm2: `BitmapData` should be traceable 2021-09-11 12:11:35 -07:00
David Wendt 31e3741982 avm2: Allow access to the `BitmapData` of a `Bitmap`. 2021-09-11 12:11:35 -07:00
David Wendt 7c5dc568f1 avm2: Impl `BitmapData.getPixel`.
This also changes the `bitmapdata_constr` test slightly to use a different starting value. Our premultiplied alpha calculations generate slightly different values from Flash Player which trips the test.
2021-09-11 12:11:35 -07:00
David Wendt 4c9bd0a6fe avm2: Impl `BitmapData.transparent` 2021-09-11 12:11:35 -07:00
David Wendt e18caa2fbf core: Silence error relating to `Bitmap` symbol class associations 2021-09-11 12:11:35 -07:00
David Wendt dca473fc2a avm2: Impl `BitmapData.width` and `BitmapData.height` 2021-09-11 12:11:35 -07:00
David Wendt 723b8b6756 tests: Add tests for `BitmapData`'s constructor, in both fresh and embedded bitmap contexts. 2021-09-11 12:11:35 -07:00
David Wendt 335aec5be0 avm2: Implement `BitmapData`'s constructor.
This includes support for both embedded bitmap data (resolved via the SymbolClass mechanism) as well as empty bitmaps configured via arguments.
2021-09-11 12:11:35 -07:00
David Wendt e5151d147d core: When constructing a `Bitmap`, do not attempt to cache it's associated `BitmapData`'s handle.
Attempting to do so results in borrow-mut panics. Furthermore, it's unnecessary; the handle provided to this function is already derived from the bitmap data in this way.
2021-09-11 12:11:35 -07:00
David Wendt 54740d6093 core: Allow `BitmapData` to hold an AVM2 side. 2021-09-11 12:11:35 -07:00
David Wendt 10b98f72f5 core: Allow `Bitmap` to be reassociated with new `BitmapData` 2021-09-11 12:11:35 -07:00
David Wendt a807cf7623 avm2: Stub `flash.display.BitmapData` & storage object 2021-09-11 12:11:35 -07:00
David Wendt fbccd75e23 tests: Add bitmap timeline test 2021-09-11 12:11:35 -07:00
David Wendt 609b97cfb9 core: Allow `Bitmap`s to hold an AVM2 representation 2021-09-11 12:11:35 -07:00
David Wendt 3c229e462a scanner: For some reason, analysis reports get cut off if I don't add another newline 2021-09-11 09:52:40 -07:00
David Wendt a180aba613 scanner: Don't reset progress when the iterator has yet to complete 2021-09-11 09:52:40 -07:00
David Wendt 400938180b scanner: Remove duplicate CSV header 2021-09-11 09:52:40 -07:00
David Wendt f7a4593ab4 scanner: Add post-scan progress analysis 2021-09-11 09:52:40 -07:00
David Wendt d08d2ec783 Actually copy all the file results field from the child into the parent 2021-09-11 09:52:40 -07:00
David Wendt 9bb5229e14 scanner: Report compressed and uncompressed file size of each SWF 2021-09-11 09:52:40 -07:00
David Wendt 37f084e3e0 scanner: Include other SWF header information in the scanner output. 2021-09-11 09:52:40 -07:00
David Wendt c55bc96993 scanner: Clean up and document the `FileResults` type a bit 2021-09-11 09:52:40 -07:00
David Wendt 5e3eaba5f8 scanner: Include SHA256 hash in scan results 2021-09-11 09:52:40 -07:00
David Wendt d084cb116f scanner: Remove 16MB stacks, as they are no longer needed now that we are using multiple processes 2021-09-11 09:52:40 -07:00
David Wendt 3294ef17e4 scanner: Break the scanner up into multiple modules 2021-09-11 09:52:40 -07:00
David Wendt 7a71cce028 scanner: Break each movie out into a separate process.
Since forking isn't an option in Rust (and is generally unsafe, incompatible with threads, and more or less not UNIX's best design idea) we instead grab the current binary path and run it again with a different subcommand.

This should allow us to grab all the panics, including uncatchable ones.

Note: this also requires that we introduce an IPC mechanism. I currently decided to have it spit out CSV rows, same as the main `scan` command. This also makes the psuedo-fork subcommand arguably useful on it's own as it will dump timing metrics for each step.
2021-09-11 09:52:40 -07:00
David Wendt 263c1133c8 scanner: Add a `scan` subcommand 2021-09-11 09:52:40 -07:00
David Wendt 75f1b40925 scanner: Deduplicate repeated log messages 2021-09-11 09:52:40 -07:00
David Wendt a284d5d13b scanner: Record test duration (in milliseconds) 2021-09-11 09:52:40 -07:00
David Wendt a18d13833c scanner: Print partial results as they come out of the parallel iterator.
This relies on a proposed serial bridge as per https://github.com/rayon-rs/rayon/issues/858. As that project is licensed the same as Ruffle itself and the submitter intended it to be included in Rayon, I believe it's legal to copy this code.
2021-09-11 09:52:40 -07:00
David Wendt 46638b1be8 scanner: Set the default scanner thread size to 16MB.
Rayon's default of 2MB is about half of what the AVM1 recursion limit requires, and I have plenty of memory, so I might as well add some padding for long runs.
2021-09-11 09:52:40 -07:00
David Wendt b49ae66ff3 scanner: Run the first frame of every movie we scan.
This currently fails to scan the entire Flashpoint `localflash` directory because Rust considers stack overflow to be an immediate program termination, no ifs, ands, or buts about it.
2021-09-11 09:52:40 -07:00
David Wendt 2b061cdba6 scanner: Report what stage of the scan got to before any errors happened 2021-09-11 09:52:40 -07:00
David Wendt 1d0e418c5c scanner: Parallelize the scan process 2021-09-11 09:52:40 -07:00
David Wendt f9c646e51f scanner: Report decompression failures as errors instead of panicking. 2021-09-11 09:52:40 -07:00
David Wendt 074cc4bc8e scanner: Report the AVM version of every scanned file 2021-09-11 09:52:40 -07:00
Chris Midgley bd26790f5b
avm1: Fix `this` inside watchers (#5276)
* fix: fix 'this' inside watchers

* tests: test value of 'this' in watcher

* lint: cargo fmt
2021-09-11 15:15:16 +03:00
Mike Welsh 9978eaa954 chore: Bump to wasm-bindgen 0.2.77 2021-09-10 16:32:14 -07:00
relrelb 923201d2e4 chore: Appease clippy 2021-09-10 15:42:37 +02:00
Chris Midgley 3e04c2b0d2 dev: remove allow unused mut and corresponding mut 2021-09-09 19:06:49 -06:00
Daniel Jacobs 5ac9796ffd web: Support salign, quality, & scale embed/object attributes (part of #4258) 2021-09-08 16:25:47 -07:00
relrelb 3aeffce365 desktop: Refactor clap settings
* Fix #5252 by passing `multiple_occurrences = true`.
* Remove `case_insensitive = true`.
* Reformat comments a bit.
2021-09-08 16:04:09 -07:00
Tal Hayon 7d6eaf127d core: Fix EditText width and height scaling (close #3001) 2021-09-08 02:39:01 -07:00
relrelb acd462745d web: Fix `publicPath()` being called from non-global scope
`document.currentScript` works only while the script is initially
being processed. This means that when `publicPath()` was called from
a non-global scope, it failed to detect where ruffle.js is located,
which in turn failed to determine the .wasm location.
2021-09-08 02:25:05 -07:00