From 78dcc0e685548997302713ccda94a6b079ecabf0 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 11 Jan 2018 22:27:11 -0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Revive=20"Push=20physical=20layers=20?= =?UTF-8?q?with=20paths=20instead=20of=20rects=20in=20RenderPhy=E2=80=A6?= =?UTF-8?q?=20(#14054)"=20(#14063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 592f297922270c0c338b0048d37a510c9c16db14. --- bin/internal/engine.version | 2 +- packages/flutter/lib/src/rendering/layer.dart | 15 ++++++++------- packages/flutter/lib/src/rendering/proxy_box.dart | 5 ++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/internal/engine.version b/bin/internal/engine.version index a02f7d06f3..059c6f8df1 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -05fe72d068e19c7886e8d27f9b004201d5ad1300 +5a72197b733c01537a6583fa3715155d9fc936ef diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index b5e04c3bf6..7224c4ae37 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -755,20 +755,20 @@ class PhysicalModelLayer extends ContainerLayer { /// Creates a composited layer that uses a physical model to producing /// lighting effects. /// - /// The [clipPath], [elevation], and [color] arguments must not be null. + /// The [clipRRect], [elevation], and [color] arguments must not be null. PhysicalModelLayer({ - @required this.clipPath, + @required this.clipRRect, @required this.elevation, @required this.color, - }) : assert(clipPath != null), + }) : assert(clipRRect != null), assert(elevation != null), assert(color != null); - /// The path to clip in the parent's coordinate system. + /// The rounded-rect to clip in the parent's coordinate system. /// /// The scene must be explicitly recomposited after this property is changed /// (as described at [Layer]). - Path clipPath; + RRect clipRRect; /// The z-coordinate at which to place this physical object. /// @@ -784,8 +784,8 @@ class PhysicalModelLayer extends ContainerLayer { @override void addToScene(ui.SceneBuilder builder, Offset layerOffset) { - builder.pushPhysicalShape( - path: clipPath.shift(layerOffset), + builder.pushPhysicalModel( + rrect: clipRRect.shift(layerOffset), elevation: elevation, color: color, ); @@ -796,6 +796,7 @@ class PhysicalModelLayer extends ContainerLayer { @override void debugFillProperties(DiagnosticPropertiesBuilder description) { super.debugFillProperties(description); + description.add(new DiagnosticsProperty('clipRRect', clipRRect)); description.add(new DoubleProperty('elevation', elevation)); description.add(new DiagnosticsProperty('color', color)); } diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 6b3d2dc844..d130ee4270 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -1426,10 +1426,9 @@ class RenderPhysicalModel extends _RenderCustomClip { _updateClip(); final RRect offsetClipRRect = _clip.shift(offset); final Rect offsetBounds = offsetClipRRect.outerRect; - final Path offsetClipPath = new Path()..addRRect(offsetClipRRect); if (needsCompositing) { final PhysicalModelLayer physicalModel = new PhysicalModelLayer( - clipPath: offsetClipPath, + clipRRect: offsetClipRRect, elevation: elevation, color: color, ); @@ -1446,7 +1445,7 @@ class RenderPhysicalModel extends _RenderCustomClip { _transparentPaint, ); canvas.drawShadow( - offsetClipPath, + new Path()..addRRect(offsetClipRRect), shadowColor, elevation, color.alpha != 0xFF,