Repository navigation
Closed
flutter-team-archive/engine
#55536Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.26Found to occur in 3.26Found to occur in 3.26frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework team
Description
I'm using matrix transform to achieve a perspective view in my app. I'm also using golden tests heavily.
Upon migrating from 3.22.3 to 3.24.3, some of my goldens do not render the widgets properly anymore. The widgets render fine in the app.
One example uses an svg(I stripped this one down and attached as a code sample).
I also have issues with a png, so I don't think its svg specific.
I'm tagging @Hixie, since I've seen a couple of mentions to golden changes in release notes of 3.24, so I'm hoping you might know something.
Steps to reproduce
- in pubspec.yaml add:
flutter:
uses-material-design: true
assets:
- assets/icons/
-
in pubspec.yaml add:
flutter_svg: ^1.1.6dependency -
add the svg under /assets/icons as ic_pound_sign.svg
source:
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 10.4628V12.6087H7.84923C7.86115 12.7279 7.86115 12.8471 7.86115 12.9663C7.86115 14.9215 6.88359 16.1613 5.19074 16.4355V20H18.7454V16.0898H11.1396V15.9467C12.2244 15.2314 12.5582 13.9439 12.5582 12.7518C12.5582 12.7041 12.5582 12.6564 12.5582 12.6087H17.3506V10.4628H12.1648C12.0337 9.96213 11.9144 9.49719 11.9144 9.03226C11.9144 7.64937 12.892 6.7195 15.014 6.7195C16.2539 6.7195 17.3029 6.91024 18.0659 7.24404V3.64376C17.446 3.28612 15.7532 3 14.108 3C9.60168 3 7.07433 5.16971 7.07433 8.12623C7.07433 8.92496 7.25316 9.69986 7.4439 10.4628H5Z" fill="white"/>
</svg>
- Add a test with the attached code sample, run it with
flutter test --update-goldens
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_test/flutter_test.dart';
Future<void> main() async {
group('Flutter Perspective in goldens regression', () {
for (final usePerspective in [false, true]) {
testWidgets(
'Simple widget ${usePerspective ? 'under' : 'without'} perspective',
(widgetTester) async {
const topLevelKey = Key('top level key');
await widgetTester.pumpWidget(
Center(
child: Container(
key: topLevelKey,
color: Colors.red,
height: 50,
width: 50,
child: Transform(
transform: Matrix4.identity()
..setEntry(3, 1, usePerspective ? 0.015 : 0),
alignment: Alignment.bottomCenter,
child: Container(
alignment: Alignment.bottomCenter,
child: SvgPicture.asset('assets/icons/ic_pound_sign.svg'),
),
),
),
),
);
await widgetTester.pump();
await expectLater(
find.byKey(topLevelKey),
matchesGoldenFile(
'goldens/simple_widget_${usePerspective ? 'under' : 'without'}_perspective.png',
),
);
},
);
}
});
}
Screenshots or Video
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
3.24:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.5 23F79 darwin-arm64, locale en-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Community Edition (version 2023.2.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!3.22:
[16](https://moneysatnav.slack.com/archives/D03C7D43F4N/p1726830992665529)
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.6.1 23G93 darwin-arm64 (Rosetta), locale en-BG)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (5 available)
[✓] Network resources
• No issues found!Reacted by Michael Stachowicz, OliverNarramore, BoyanCreo, Krzysztof Świętnicki and Mark Bean
Reacted by Michael Stachowicz, BoyanCreo, Krzysztof Świętnicki, Mark Bean and OliverNarramore
Metadata
Metadata
Assignees
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.26Found to occur in 3.26Found to occur in 3.26frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework team




Activity
danagbemava-nc commentedon Sep 20, 2024
Reproducible using the code sample and steps outlined above.
flutter doctor -v
Piinks commentedon Sep 25, 2024
@FufferKS can you remove the dependency on
package:flutter_svg/svg.dart? The issue may be in that package rather than the flutter framework.FufferKS commentedon Sep 26, 2024
I'll do my best to prepare a repro without it tomorrow.
However, my repro had the failures on the exact same version of flutter_svg on both flutter versions (checked in pubspec.lock) and on my app I'm experiencing the same perspective issue on a png asset, so I highly doubt it's svg's fault.
jason-simmons commentedon Sep 29, 2024
This started with the change to using Impeller geometry classes in
DisplayListMatrixClipTracker(flutter-team-archive/engine@0226114)The difference happens because
impeller::Matrix::Translatedoes not match the behavior of Skia'sSkM44::preTranslatefor the perspective matrix used in this example. Specifically,impeller::Matrix::Translateis copyingm[15]into the output instead of multiplying against the translation vector.This renders as expected if I change
Matrix::Translateto:@chinmaygarde @flar
FufferKS commentedon Sep 30, 2024
Sorry for the delay, here is a repro with no svg.
3.24:


under perspective:
3.24:
without perspective:
3.22:


under perspective:
3.22:
without perspective:
FufferKS commentedon Sep 30, 2024
Regarding the comment from @jason-simmons, I should have mentioned that our app currently opts out of Impeller due to
#153221
#128885
#149165
Does it mean that between 3.22 and 3.24 the goldens started using the Impeller engine? My knowledge ends here, I am not sure if this question even makes sense.
FufferKS commentedon Sep 30, 2024
Sorry it's also worth mentioning, that in the List/Item example a single Item renders fine, only wrapping it in the list starts to misbehave.
[Impeller] Fix handling of perspective matrices in Matrix::Translate
[Impeller] Fix handling of perspective matrices in Matrix::Translate (f…
github-actions commentedon Oct 18, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[Impeller] Fix handling of perspective matrices in Matrix::Translate (f…