From 28ba95abb18fd2eb931e211e814a7807570cc644 Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Thu, 13 Sep 2018 00:32:12 -0700 Subject: [PATCH] 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. --- bin/internal/goldens.version | 2 +- packages/flutter/lib/src/widgets/basic.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/internal/goldens.version b/bin/internal/goldens.version index 5f3d3fa934..502ab1e0fa 100644 --- a/bin/internal/goldens.version +++ b/bin/internal/goldens.version @@ -1 +1 @@ -73aaafada280dbc726c6bfab510dd7b46fc7e3be +da68caa0a261663858998e047c02560e94404e7a diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 1ae14f7c34..9223dd9c6e 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -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 clipper;