Unverified Commit 8cf109d2 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Reland #14054 after having landed all the engine commits in between (#14064)

This gets us back to where we were a few minutes ago.
parent e859995d
f5dc4ec7391a755fb0040c006f15340a34799c21 05fe72d068e19c7886e8d27f9b004201d5ad1300
...@@ -755,20 +755,20 @@ class PhysicalModelLayer extends ContainerLayer { ...@@ -755,20 +755,20 @@ class PhysicalModelLayer extends ContainerLayer {
/// Creates a composited layer that uses a physical model to producing /// Creates a composited layer that uses a physical model to producing
/// lighting effects. /// lighting effects.
/// ///
/// The [clipRRect], [elevation], and [color] arguments must not be null. /// The [clipPath], [elevation], and [color] arguments must not be null.
PhysicalModelLayer({ PhysicalModelLayer({
@required this.clipRRect, @required this.clipPath,
@required this.elevation, @required this.elevation,
@required this.color, @required this.color,
}) : assert(clipRRect != null), }) : assert(clipPath != null),
assert(elevation != null), assert(elevation != null),
assert(color != null); assert(color != null);
/// The rounded-rect to clip in the parent's coordinate system. /// The path to clip in the parent's coordinate system.
/// ///
/// The scene must be explicitly recomposited after this property is changed /// The scene must be explicitly recomposited after this property is changed
/// (as described at [Layer]). /// (as described at [Layer]).
RRect clipRRect; Path clipPath;
/// The z-coordinate at which to place this physical object. /// The z-coordinate at which to place this physical object.
/// ///
...@@ -784,8 +784,8 @@ class PhysicalModelLayer extends ContainerLayer { ...@@ -784,8 +784,8 @@ class PhysicalModelLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder, Offset layerOffset) { void addToScene(ui.SceneBuilder builder, Offset layerOffset) {
builder.pushPhysicalModel( builder.pushPhysicalShape(
rrect: clipRRect.shift(layerOffset), path: clipPath.shift(layerOffset),
elevation: elevation, elevation: elevation,
color: color, color: color,
); );
...@@ -796,7 +796,6 @@ class PhysicalModelLayer extends ContainerLayer { ...@@ -796,7 +796,6 @@ class PhysicalModelLayer extends ContainerLayer {
@override @override
void debugFillProperties(DiagnosticPropertiesBuilder description) { void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description); super.debugFillProperties(description);
description.add(new DiagnosticsProperty<RRect>('clipRRect', clipRRect));
description.add(new DoubleProperty('elevation', elevation)); description.add(new DoubleProperty('elevation', elevation));
description.add(new DiagnosticsProperty<Color>('color', color)); description.add(new DiagnosticsProperty<Color>('color', color));
} }
......
...@@ -1426,9 +1426,10 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> { ...@@ -1426,9 +1426,10 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
_updateClip(); _updateClip();
final RRect offsetClipRRect = _clip.shift(offset); final RRect offsetClipRRect = _clip.shift(offset);
final Rect offsetBounds = offsetClipRRect.outerRect; final Rect offsetBounds = offsetClipRRect.outerRect;
final Path offsetClipPath = new Path()..addRRect(offsetClipRRect);
if (needsCompositing) { if (needsCompositing) {
final PhysicalModelLayer physicalModel = new PhysicalModelLayer( final PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipRRect: offsetClipRRect, clipPath: offsetClipPath,
elevation: elevation, elevation: elevation,
color: color, color: color,
); );
...@@ -1445,7 +1446,7 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> { ...@@ -1445,7 +1446,7 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
_transparentPaint, _transparentPaint,
); );
canvas.drawShadow( canvas.drawShadow(
new Path()..addRRect(offsetClipRRect), offsetClipPath,
shadowColor, shadowColor,
elevation, elevation,
color.alpha != 0xFF, color.alpha != 0xFF,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment