Default clipBehavior of ClipRect to hardEdge. (#21703)

Previously, the engine did not properly pass the AA flag on ClipRect.clipBehavior. flutter/engine#6199 fixes this and enables AA. However, default AA on clipRects has caused severe regressions in benchmark performance.

To maintain expected performance, we should now default the clipBehavior to hardEdge to disable default AA. This is consistent with any flutter projects that did not previously explicitly set the clipBehavior and should not change app appearance.
This commit is contained in:
Gary Qian
2018-09-13 00:32:12 -07:00
committed by GitHub
parent d61b48b75d
commit 28ba95abb1
2 changed files with 2 additions and 2 deletions

View File

@@ -1 +1 @@
73aaafada280dbc726c6bfab510dd7b46fc7e3be
da68caa0a261663858998e047c02560e94404e7a

View File

@@ -496,7 +496,7 @@ class ClipRect extends SingleChildRenderObjectWidget {
///
/// If [clipper] is null, the clip will match the layout size and position of
/// the child.
const ClipRect({ Key key, this.clipper, this.clipBehavior = Clip.antiAlias, Widget child }) : super(key: key, child: child);
const ClipRect({ Key key, this.clipper, this.clipBehavior = Clip.hardEdge, Widget child }) : super(key: key, child: child);
/// If non-null, determines which clip to use.
final CustomClipper<Rect> clipper;