-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#33131Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtc: regressionIt was better in the past than it is nowIt was better in the past than it is nowc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 2.13Found to occur in 2.13Found to occur in 2.13has 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 version
Description
When painting text using a radial gradient in the current beta of flutter (2.13.0-0.pre), the results are not as expected, as compared to what is produced by the current stable version (2.10.5). I believe the stable version is correct, and the beta version is wrong.
The results are consistent on both MacOS and Linux. That is to say, stable produces results believed to be correct on both, and beta produces results believed to be wrong on both.
Steps to Reproduce
Execute flutter test test/flutter_bug_radial_gradient.dart and look at the flutter_bug.png image produced.
| Expected results (stable 2.10.5) | Actual results (beta 2.13.0-0.3.pre) |
|---|---|
![]() |
![]() |
Code sample
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart' as material;
import 'dart:ui';
void main() async {
final recorder = PictureRecorder();
final Canvas c = Canvas(recorder);
final Paint p = Paint();
final xform = Float64List.fromList([
86.80000129342079,
0.0,
0.0,
0.0,
0.0,
94.5,
0.0,
0.0,
0.0,
0.0,
1.0,
0.0,
60.0,
224.310302734375,
0.0,
1.0
]);
p.shader = Gradient.radial(
Offset(2.5, 0.33),
0.8,
[
Color(0xffff0000),
Color(0xff00ff00),
Color(0xff0000ff),
Color(0xffff00ff)
],
[0.0, 0.3, 0.7, 0.9],
TileMode.mirror,
xform,
Offset(2.55, 0.4));
final span = material.TextSpan(
style: material.TextStyle(foreground: p, fontSize: 200), text: 'Woodstock!');
final tp = material.TextPainter(text: span, textDirection: TextDirection.ltr);
tp.layout();
tp.paint(c, Offset(10, 150));
final Picture pict = recorder.endRecording();
final Image rendered = await pict.toImage(600, 400);
final bd = await rendered.toByteData(format: ImageByteFormat.png);
final bytes = Uint8List.fromList(bd!.buffer.asUint8List());
File('flutter_bug.png').writeAsBytesSync(bytes);
print('Wrote ${bytes.length} to flutter_bug.png');
}
Logs
billf@Zathras:~/github/jovial_svg$ flutter test test/flutter_bug_radial_gradient.dart --verbose
[ +89 ms] executing: uname -m
[ +41 ms] Exit code 0 from: uname -m
[ ] x86_64
[ +8 ms] executing: [/home/billf/snap/flutter/common/flutter/] git -c
log.showSignature=false log -n 1 --pretty=format:%H
[ +11 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[ ] 5293f3cd4427b4b48ed155e7a3852c6b3c53d94a
[ ] executing: [/home/billf/snap/flutter/common/flutter/] git tag
--points-at 5293f3cd4427b4b48ed155e7a3852c6b3c53d94a
[ +17 ms] Exit code 0 from: git tag --points-at
5293f3cd4427b4b48ed155e7a3852c6b3c53d94a
[ ] 2.13.0-0.3.pre
[ +11 ms] executing: [/home/billf/snap/flutter/common/flutter/] git rev-parse
--abbrev-ref --symbolic @{u}
[ +6 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/beta
[ ] executing: [/home/billf/snap/flutter/common/flutter/] git ls-remote
--get-url origin
[ +6 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +104 ms] Unable to locate an Android SDK.
[ +8 ms] executing: [/home/billf/snap/flutter/common/flutter/] git rev-parse
--abbrev-ref HEAD
[ +7 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] beta
[ +92 ms] Found 1 files which will be executed as Widget Tests.
[ +8 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[ +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[ +76 ms] Artifact Instance of 'MaterialFonts' is not required, skipping
update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping
update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'PubDependencies' is not required, skipping
update.
[ +66 ms] Skipping pub get: version match.
[ +230 ms] running test package with arguments: [-r, compact, --timeout, 30s,
--concurrency=2, --chain-stack-traces, --,
/home/billf/github/jovial_svg/test/flutter_bug_radial_gradient.dart]
00:00 +0: ...billf/github/jovial_svg/test/flutter_bug_radial_gradient.dart [ +246 ms] test 0: starting test
/home/billf/github/jovial_svg/test/flutter_bug_radial_gradient.dart
[ +7 ms] Stopping scan for flutter_test_config.dart; found project root at
/home/billf/github/jovial_svg
[ +3 ms] Compiler will use the following file as its incremental dill file:
/tmp/flutter_tools.GTUDWG/flutter_test_compiler.QJQUQJ/output.dill
[ ] Listening to compiler controller...
[ +13 ms] Compiling
file:///tmp/flutter_tools.GTUDWG/flutter_test_listener.HGRYPT/listener.dart
[ +54 ms] /home/billf/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart
--disable-dart-dev
/home/billf/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/snapshots/fronten
d_server.dart.snapshot --sdk-root
/home/billf/snap/flutter/common/flutter/bin/cache/artifacts/engine/common/flutte
r_patched_sdk/ --incremental --no-print-incremental-dependencies
--target=flutter --debugger-module-names --experimental-emit-debug-metadata
-DFLUTTER_WEB_AUTO_DETECT=true --output-dill
/tmp/flutter_tools.GTUDWG/flutter_test_compiler.QJQUQJ/output.dill --packages
/home/billf/github/jovial_svg/.dart_tool/package_config.json
-Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --initialize-from-dill
/home/billf/github/jovial_svg/build/test_cache/build/c075001b96339384a97db4862b8
ab8db.cache.dill.track.dill
[ +25 ms] <- compile
file:///tmp/flutter_tools.GTUDWG/flutter_test_listener.HGRYPT/listener.dart
00:01 +0: ...billf/github/jovial_svg/test/flutter_bug_radial_gradient.dart [+1381 ms] <- accept
[ ] <- reset
[ ] Compiling
file:///tmp/flutter_tools.GTUDWG/flutter_test_listener.HGRYPT/listener.dart took
1461ms
[ ] test 0: starting test device
[ +11 ms] test 0: awaiting connection to test device
[ +6 ms] test 0: Observatory uri is not available
[ +9 ms] test 0: test harness socket server is running at port:36101
[ ] executing: uname -m
[ +5 ms] Exit code 0 from: uname -m
[ ] x86_64
[ +1 ms] Using this directory for fonts configuration:
/tmp/flutter_tools.GTUDWG/flutter_test_fonts.DBLATU
[ +1 ms] test 0: Starting flutter_tester process with
command=[/home/billf/snap/flutter/common/flutter/bin/cache/artifacts/engine/linu
x-x64/flutter_tester, --disable-observatory, --enable-checked-mode,
--verify-entry-points, --enable-software-rendering,
--skia-deterministic-rendering, --enable-dart-profiling, --non-interactive,
--use-test-fonts,
--packages=/home/billf/github/jovial_svg/.dart_tool/package_config.json,
/tmp/flutter_tools.GTUDWG/flutter_test_listener.HGRYPT/listener.dart.dill],
environment={FLUTTER_TEST: true, FONTCONFIG_FILE:
/tmp/flutter_tools.GTUDWG/flutter_test_fonts.DBLATU/fonts.conf, SERVER_PORT:
36101, APP_NAME: jovial_svg, UNIT_TEST_ASSETS:
/home/billf/github/jovial_svg/build/unit_test_assets}
[ +5 ms] test 0: Started flutter_tester process at pid 5740
00:02 +0: ...billf/github/jovial_svg/test/flutter_bug_radial_gradient.dart [ +489 ms] test 0: connected to test device, now awaiting test result
[ ] test 0: Waiting for test harness or tests to finish
00:02 +0: loading /home/billf/github/jovial_svg/test/flutter_bug_radial_gradient.dart
Wrote 247966 to flutter_bug.png
[ +195 ms] test 0: Test harness is no longer needed by test process
[ ] test 0: finished
[ +2 ms] test 0: cleaning up...
[ ] test 0: ensuring test device is terminated.
[ ] test 0: Terminating flutter_tester process
[ ] test 0: Shutting down test harness socket server
[ ] test 0: Test process is no longer needed by test harness
[ +11 ms] test 0: flutter_tester process at pid 5740 exited with code=-9
[ ] test 0: deleting temporary directory
[ +6 ms] test 0: finished
No tests ran.
No tests were found.
[ +15 ms] Deleting /tmp/flutter_tools.GTUDWG/flutter_test_compiler.QJQUQJ...
[ +6 ms] killing pid 5732
[ +54 ms] Deleting /tmp/flutter_tools.GTUDWG/flutter_test_fonts.DBLATU...
[ +3 ms] test package returned with exit code 79
[ +11 ms] "flutter test" took 3,007ms.
[ +6 ms]
#0 throwToolExit
(package:flutter_tools/src/base/common.dart:10:3)
#1 TestCommand.runCommand
(package:flutter_tools/src/commands/test.dart:471:7)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1183:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand
(package:args/command_runner.dart:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
[ +8 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
Analyzing test...
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:29:7 • prefer_const_constructors
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:32:9 • prefer_const_constructors
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:33:9 • prefer_const_constructors
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:34:9 • prefer_const_constructors
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:35:9 • prefer_const_constructors
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:40:7 • prefer_const_constructors
info • Prefer const with constant constructors • flutter_bug_radial_gradient.dart:45:15 • prefer_const_constructors
7 issues found. (ran in 2.1s)
[✓] Flutter (Channel beta, 2.13.0-0.3.pre, on Ubuntu 20.04.4 LTS 5.13.0-40-generic, locale en_US.UTF-8)
• Flutter version 2.13.0-0.3.pre at /home/billf/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5293f3cd44 (5 days ago), 2022-04-27 12:37:50 -0700
• Engine revision 3096903c89
• Dart version 2.17.0 (build 2.17.0-266.7.beta)
• DevTools version 2.12.2
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
• clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
• cmake version 3.10.2
• ninja version 1.8.2
• pkg-config version 0.29.1
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.4 LTS 5.13.0-40-generic
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 3 categories.
Metadata
Metadata
Assignees
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtc: regressionIt was better in the past than it is nowIt was better in the past than it is nowc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 2.13Found to occur in 2.13Found to occur in 2.13has 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 version

