-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Severe performance issue on MacOS chrome #66
Comments
Heres a deployed app to verify https://chromebug.netlify.app/ |
Hi @maheshmnj, thanks for bringing this to my attention. I can confirm that I'm experiencing the same issue. Definitely a problem with Chrome and CanvasKit. Here's an old build I have that used to run fine on chrome: https://funwithflutter.github.io/confetti/#/ We will need to report this on Flutter's repo, or potentially Skia. |
Hi @maheshmnj any update on this issue? |
@funwithflutter This is a bug in the Chrome browser currently being tracked here https://bugs.chromium.org/p/chromium/issues/detail?id=1330463. Let's hope the chrome team fixes it soon. |
@maheshmnj it seems like part of the issue is with the native use of Path on Chrome. In the confetti package a square path is drawn: final pathShape = Path()
..moveTo(0, 0)
..lineTo(-size.width, 0)
..lineTo(-size.width, size.height)
..lineTo(0, size.height)
..close(); And later the path is transformed: final rotationMatrix4 = Matrix4.identity()
..translate(particle.location.dx, particle.location.dy)
..rotateX(particle.angleX)
..rotateY(particle.angleY)
..rotateZ(particle.angleZ);
final finalPath = particle.path.transform(rotationMatrix4.storage);
canvas.drawPath(finalPath, _particlePaint..color = particle.color); The call to void _transform(Path outPath, Float64List matrix4) native 'Path_transform'; What is interesting is if you introduce more points to the Path the problem goes away. final pathShape = Path()
..moveTo(0, 0)
..lineTo(-size.width, 0)
..lineTo(-size.width, size.height)
..lineTo(0, size.height)
// INTRODUCE MORE POINTS
..lineTo(0, 0)
..lineTo(-size.width, 0)
..lineTo(-size.width, size.height)
..lineTo(0, size.height)
//
..close(); This can also be observed in the sample, where the stars' confetti (with more path points) does not cause an issue, but the square paths do. |
Not closing this issue for now, as the underlying problem has not gone away. I've only added additional path points when the target is web to prevent the above for the Confetti package. |
This is very likely a bug in chrome, I am not sure where to report it so I am reporting it here
chrome version
This issue is only on the macOS version of chrome and works fine on Windows and Linux.
code sample
Output comparison chrome vs Firefox on a mac m1
confetti.mp4
flutter doctor -v (mac)
The text was updated successfully, but these errors were encountered: