Skip to content

render: Improve gradient rendering#23059

Open
ChrisCPI wants to merge 4 commits intoruffle-rs:masterfrom
ChrisCPI:gradient-fixes
Open

render: Improve gradient rendering#23059
ChrisCPI wants to merge 4 commits intoruffle-rs:masterfrom
ChrisCPI:gradient-fixes

Conversation

@ChrisCPI
Copy link
Contributor

@ChrisCPI ChrisCPI commented Feb 17, 2026

Fixes #21593 .

Rather than trying to grab the record with the lowest possible ratio and drawing it, wait until the current record has been drawn up to its ratio before moving on to the next record.

Also fixes some edge cases relating to when records have the same ratio.

The tests may need some work, because:

  • The Flash Player snapshots don't look correct (edges of shapes look pretty crispy), but I don't have a better way of snapshotting it.
  • I'm not sure what the correct balance is for setting the tolerance/max_outliers, and I'm also not sure if having them as high as they are is acceptable (going back to the first point).

@ChrisCPI ChrisCPI marked this pull request as draft February 17, 2026 23:16
@ChrisCPI ChrisCPI force-pushed the gradient-fixes branch 7 times, most recently from ed3d139 to 6d10b47 Compare February 23, 2026 03:39
@ChrisCPI ChrisCPI marked this pull request as ready for review February 23, 2026 04:08
@ChrisCPI ChrisCPI force-pushed the gradient-fixes branch 2 times, most recently from e867182 to ff71022 Compare February 25, 2026 18:17
@ChrisCPI ChrisCPI requested a review from kjarosh February 25, 2026 18:32
@ChrisCPI
Copy link
Contributor Author

Thinking about it, do I also need to update visual/gradient_issue_9892's expected output to be from Flash Player? (I'll only do this myself if the change with from_gnash/misc-ming.all/GradientFillTest looks good)

@kjarosh
Copy link
Member

kjarosh commented Feb 28, 2026

Usually you'd do it in a separate PR and then rebase this one on top of that one. Otherwise you're breaking the test first and then fixing it.

@Lord-McSweeney Lord-McSweeney added A-rendering Area: Rendering & Graphics T-fix Type: Bug fix (in something that's supposed to work already) labels Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rendering Area: Rendering & Graphics T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inaccuracies when a gradient has out-of-order ratios

3 participants