Skip to content

fix(🐛): swap the skew shear axes in the native recorder too - #4020

Merged
wcandillon merged 2 commits into
Shopify:mainfrom
dennytosp:fix/skew-shear-axes-in-native-recorder
Aug 23, 2026
Merged

fix(🐛): swap the skew shear axes in the native recorder too#4020
wcandillon merged 2 commits into
Shopify:mainfrom
dennytosp:fix/skew-shear-axes-in-native-recorder

Conversation

@dennytosp

Copy link
Copy Markdown
Contributor

Follow-up to #4015 — that PR is why main is currently red.

What went wrong

#4015 fixed skewX/skewY in processTransform3d, but the native recorder keeps its own copy of that conversion in cpp/api/recorder/Convertor.h, and that copy has the same two axes swapped. Only the TypeScript side was corrected, so the two backends now disagree.

The snapshots were regenerated for the corrected behaviour, so native is the one that fails. On main today:

job result
build-test-ios-graphite (run) Transforms.spec.tsx — both skew tests fail, 167673 px diff
test-android (on open PRs, which merge with main) same two tests, 167047 / 167045 px diff

The fix

SkM44’s constructor reads its arguments in row-major order — the same layout as the Matrix4 tuple in TypeScript. So the two argument lists are now literally identical to the arrays in Matrix4.ts:

// skewX — shear factor in row 0, scaling y into x
SkM44 skewX(1, std::tan(angle), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
// skewY — shear factor in row 0 of column 0, scaling x into y
SkM44 skewY(1, 0, 0, 0, std::tan(angle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

The perspective case a few lines below is a useful control: its C++ argument list already matches the TypeScript array element for element, and its snapshot passes on native — which is what confirms the constructor convention.

Testing

No new test: Transforms.spec.tsx already covers both axes and already fails on main, so test-android and build-test-ios-graphite going green here is the verification. I have no local Skia build, so I could not run the native path myself — CI is the check.

Sorry for the breakage.

Shopify#4015 fixed processTransform3d but missed the C++ mirror of it in the
native recorder, which builds the same matrix for transform props with
the same two axes swapped. The SkM44 constructor reads its arguments
row-major, so skewX has to put tan(angle) in row 0 - exactly like the
TypeScript version it shadows.

Since the snapshots were regenerated for the corrected behaviour, native
now disagrees with them and Transforms.spec fails on main for both
test-android and build-test-ios-graphite.
@wcandillon
wcandillon self-requested a review August 22, 2026 16:44

@wcandillon wcandillon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thks a lot

@wcandillon
wcandillon merged commit 800eb8f into Shopify:main Aug 23, 2026
8 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants