ruffle/core/src
Aaron Hill 66aad3ebc5 core: Use a separate matrix for stage alignment and HiDPI scaling
The stage alignment settings viewport_scale_factor should *not* be
applied to `Stage.transform.matrix`, which is only ever changed
as a result of explicit modification from ActionScript. Instead,
alignment and scaling are performed a separate step, which is
transparent to ActionScript.

I've implemented this through a new `viewport_matrix` field,
which is used during stage rendering and mouse coordinate
transformation.

This makes Stage3D instances properly scale - previously, they
would render unscaled. The linux standalone Flash Player doesn't
seem to use HiDPI mode, so I didn't realize that this was a bug
until now.

In the process of implementing this, I discovered and fixed a bug
with how we handle changing the viewport size under winit.
Calling `self.window.set_inner_size` does not immediately take
effect (at least on X11) - calling `self.window.inner_size()`
will report the old size until the next resize event.
Since build our Stage matrices from `self.window.inner_size()`
(and start running the SWF) immediately after `RuffleEvent::OnMetadata`,
we would run a few SWF frames with an incorrect viewport size. This
is visible to SWFs that have the scale mode set to "noScale", and
could break SWFs that expect the initial viewport size to be
the movie size. I've fixed this by delaying SWF execution until
we get a Resize event (if `self.window.inner_size()` does not
immediately report the size we set).
2023-03-13 02:02:40 -05:00
..
avm1 avm2: Remove `run_frame_avm2` and FramePhase::Update 2023-03-10 19:37:19 -07:00
avm2 core: Use a separate matrix for stage alignment and HiDPI scaling 2023-03-13 02:02:40 -05:00
backend web/ui: Open the virtual keyboard when clicking an editable EditText 2023-03-01 08:15:58 +02:00
bitmap render: Make retrieve_offscreen_texture pass the raw buffer (#9936) 2023-03-13 00:00:42 +00:00
display_object core: Use a separate matrix for stage alignment and HiDPI scaling 2023-03-13 02:02:40 -05:00
html core::html: correctly encode text in FormatSpans::to_html 2023-01-29 11:19:16 -06:00
xml Remove 'gc_context lifetime 2023-01-06 19:20:39 -05:00
avm1.rs avm1: Refactor movieclip path logic 2023-03-01 22:36:39 +01:00
avm2.rs core: Run frames for 'orphan' AVM2 MovieClips 2023-03-06 20:53:35 -06:00
backend.rs core: Made core no longer depend on software video decoders 2022-09-04 17:46:58 -07:00
binary_data.rs core: Made SwfSlice::to_subslice return an empty slice in case of errors 2022-08-21 20:12:10 -07:00
bitmap.rs core: `ColorTransform` cleanup 2022-09-23 11:10:12 +03:00
character.rs core: Use unnamed field in `Character::Bitmap` 2023-02-16 19:02:57 +02:00
compatibility_rules.rs chore: Appease clippy 2023-03-01 21:25:19 +01:00
config.rs desktop: Add --letterbox option 2023-02-09 23:43:25 -08:00
context.rs core: Remove some unused `RenderContext` fields 2023-02-28 17:48:57 +02:00
context_menu.rs core: Add quality options to the context menu 2023-02-06 16:08:04 +01:00
display_object.rs core: Use a separate matrix for stage alignment and HiDPI scaling 2023-03-13 02:02:40 -05:00
drawing.rs render: Replace `BoundingBox` with `swf::Rectangle` 2023-03-04 21:54:23 +02:00
ecma_conversions.rs avm1: Format floating-point numbers 2022-04-09 22:40:59 -07:00
either.rs avm2: Implement call stack & stack traces (#7564) 2022-08-28 18:30:20 +02:00
events.rs core: Derive Clone and Copy in PlayerEvent (#9882) 2023-03-07 16:37:56 +00:00
external.rs avm1: Remove some mc todos 2023-03-01 22:36:39 +01:00
focus_tracker.rs web/ui: Open the virtual keyboard when clicking an editable EditText 2023-03-01 08:15:58 +02:00
font.rs swf: Make `Twips::new` a `const fn` 2023-03-04 21:54:23 +02:00
frame_lifecycle.rs avm2: Remove `run_frame_avm2` and FramePhase::Update 2023-03-10 19:37:19 -07:00
html.rs core: Add methods for introspecting text metrics on an `EditText`. 2022-11-20 17:13:48 -07:00
lib.rs core: Add CompatibilityRules struct for on-the-fly replacements for compatibility. Initially konggames -> kongregate.com rules 2023-03-01 21:25:19 +01:00
library.rs core: Use unnamed field in `Character::Bitmap` 2023-02-16 19:02:57 +02:00
limits.rs Remove 'gc_context lifetime 2023-01-06 19:20:39 -05:00
loader.rs core: Only apply 'unload' and 'removed' logic to AVM1 2023-03-09 12:34:16 -06:00
locale.rs chore: Upgrade deprecated timezone code. 2022-11-21 18:50:46 -07:00
player.rs core: Only apply 'unload' and 'removed' logic to AVM1 2023-03-09 12:34:16 -06:00
prelude.rs render: Replace `BoundingBox` with `swf::Rectangle` 2023-03-04 21:54:23 +02:00
string.rs core: Simplify new_utf8_bytes 2022-07-25 10:52:56 -07:00
stub.rs avm2: Mark Dictionary(true) and TimerEvent.updateAfterEvent() as stubs 2023-02-07 20:34:59 +01:00
tag_utils.rs core: Require `SwfMovie::url` 2023-02-28 19:05:20 +02:00
timer.rs core: Only apply 'unload' and 'removed' logic to AVM1 2023-03-09 12:34:16 -06:00
types.rs core: Move `F64Extension` to `avm1` 2023-02-28 19:22:37 +02:00
vminterface.rs core: Replace some derived Debug impls with manual ones 2023-01-03 18:03:23 -05:00
xml.rs xml: Refactor `XmlNode` creation methods 2022-04-08 16:34:57 -07:00