From 61a8132ea977f2907df45e00d0d1b1765fc95f07 Mon Sep 17 00:00:00 2001 From: amirh Date: Mon, 8 Jan 2018 19:24:19 -0800 Subject: [PATCH] Revert "Push physical layers with paths instead of rects in RenderPhysicalModel. (#13942)" (#13988) This reverts commit 57b4a52555388a613d3e4d5378b5bdf761d5f8df. --- 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 14a110da2b0..609a229a799 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -d8740c70a58ada74aff5b773e2bec9d622c42a97 +6a724f0d3e22d41246baf3447d7ba2c9ff886765 diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index b5e04c3bf6a..7224c4ae374 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 eb4e6effaa9..79e9e2294f3 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,