Closed Bug 1064110 Opened 10 years ago Closed 10 years ago

Draw shapes in global coordinate space and implement Flash's stroke scaling model

Categories

(Firefox Graveyard :: Shumway, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: till, Assigned: mbx)

References

Details

There's an impedance mismatch between Flash's vector drawing model and that of Canvas2D[1]: Flash applies scaling of stroke widths once by (depending on settings for the shape) using the concatenated horizontal scaling, vertical scaling, or a geometric average of the two. The calculated width is then uniformly applied at every point on the stroke. Canvas2D, OTOH, calculates scaling for each point individually. I.e., horizontal line segments aren't affected by vertical scaling and vice versa, with non-axis-alined line segments being partly affected. Additionally, Flash draws all strokes with at least 1px on-stage width, whereas Canvas draws finer-in-appearance lines by interpolating colors accordingly. To fix both of these, we have to apply any transforms to the geometry only, not the stroke style. That's only possible by building the untransformed geometry in a Path2D and, each time we rasterize, adding that with the current concatenated transform applied to a temporary Path2D, which we then draw in global coordinate space. [1]: well, there are various, but this is one of them.
Assignee: nobody → mbebenita
PR: https://github.com/mozilla/shumway/pull/1694 I am not able to figure out exactly how Flash scales strokes, but I think the solution I have right now work for most content.
Yury, some ref tests need to be updated. Also, it looks like chrome is failing on botio for the tiger test, although it is working for me locally.
Flags: needinfo?(ydelendik)
(In reply to Michael Bebenita [:mbx] from comment #2) > Yury, some ref tests need to be updated. Also, it looks like chrome is > failing on botio for the tiger test, although it is working for me locally. The reftests auto-update once a PR is merged to master. As long as none of the tracetests fail, that is. The tiger thing is weird, though. Might be a timing issue, though I don't see why that should've been regressed by your changes.
Flags: needinfo?(ydelendik)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.