Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Do not enable antialiasing by default in CanvasKit mode #17534

Merged
merged 3 commits into from
Apr 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/web_ui/lib/src/engine/compositor/surface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ class Surface {
..position = 'absolute'
..width = '${logicalSize.width.ceil()}px'
..height = '${logicalSize.height.ceil()}px';
final int glContext = canvasKit
.callMethod('GetWebGLContext', <html.CanvasElement>[htmlCanvas]);
final int glContext = canvasKit.callMethod('GetWebGLContext', <dynamic>[
htmlCanvas,
js.JsObject.jsify({'antialias': 0}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a comment above explaining why it's OK to set it to 0 here. For example, I imagine it doesn't disable AA globally but let's Skia control it?

Copy link
Contributor Author

@harryterkelsen harryterkelsen Apr 6, 2020

Choose a reason for hiding this comment

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

Done.

Yes, this flag doesn't force-disable anti-aliasing: it just sets the default to have no anti-aliasing.

]);
final js.JsObject grContext =
canvasKit.callMethod('MakeGrContext', <dynamic>[glContext]);
final js.JsObject skSurface =
Expand Down