-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Note that I will submit a PR in the coming days for this issue, so its more of an FYI.
Description
CalculateVisibleBoundingRect
attempts to perform an intersection out of matrix transformation from the AP owner to the parent, using matrix inversion. In most simple cases, there will either be identity matrix or just a standard matrix transform.
In the case displayed, TrySimpleTransformToAncestor
returns a Matrix
, which then inside InternalTransformToAncestor
creates a MatrixTransform
, which is forced to box this Matrix
, just to immediately invoke Inverse
property (inherited via Transform
abstraction), which is then inverted and once again, a MatrixTransform
is created and Matrix
must be boxed.
All this can be special-cased with a few lines avoided and done on stack instead, which in this case would save around 800 MB, which is most of what this app has allocated.
Showcase
Repro
Note: This repro is specifically crafted to highlight an issue like this.