Skip to content

Commit 4f2cb06

Browse files
Harry Terkelsengoderbauer
authored andcommitted
Do not enable antialiasing by default in CanvasKit mode (flutter#17534)
* Do not enable antialiasing by default in CanvasKit mode * Add comment
1 parent ec4b86f commit 4f2cb06

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/web_ui/lib/src/engine/compositor/surface.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ class Surface {
114114
..position = 'absolute'
115115
..width = '${logicalSize.width.ceil()}px'
116116
..height = '${logicalSize.height.ceil()}px';
117-
final int glContext = canvasKit
118-
.callMethod('GetWebGLContext', <html.CanvasElement>[htmlCanvas]);
117+
final int glContext = canvasKit.callMethod('GetWebGLContext', <dynamic>[
118+
htmlCanvas,
119+
// Default to no anti-aliasing. Paint commands can be explicitly
120+
// anti-aliased by setting their `Paint` object's `antialias` property.
121+
js.JsObject.jsify({'antialias': 0}),
122+
]);
119123
final js.JsObject grContext =
120124
canvasKit.callMethod('MakeGrContext', <dynamic>[glContext]);
121125
final js.JsObject skSurface =

0 commit comments

Comments
 (0)