From e1e97b913055efe3289ddfda56ca4a71132ef8d4 Mon Sep 17 00:00:00 2001 From: amirh Date: Tue, 16 Jan 2018 18:20:18 -0800 Subject: [PATCH] Fallback to compose shapes as their bounding rectangles. (#4553) Scenic doesn't currently support arbitrary shaped frames. --- flow/layers/physical_shape_layer.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flow/layers/physical_shape_layer.h b/flow/layers/physical_shape_layer.h index 4e82ac693..db6d75646 100644 --- a/flow/layers/physical_shape_layer.h +++ b/flow/layers/physical_shape_layer.h @@ -23,6 +23,12 @@ class PhysicalShapeLayer : public ContainerLayer { frameRRect_ = SkRRect::MakeRect(rect); } else if (path.isRRect(&frameRRect_)) { isRect_ = frameRRect_.isRect(); + } else { + // Fuchsia's compositor currently only supports rounded rectangle frames. + // For shapes that cannot be represented as a rounded rectangle we + // default to use the bounding rectangle. + // TODO(amirh): fix this once Fuchsia supports arbitrary shaped frames. + frameRRect_ = SkRRect::MakeRect(path.getBounds()); } } -- GitLab