[Breaking Change] Composite layers for physical shapes on all platforms

28 views
Skip to first unread message

Dan Field

unread,
Mar 6, 2019, 11:30:56 PM3/6/19
to flutter-...@googlegroups.com, flutt...@googlegroups.com
TL;DR: I would like to change the way we handle Material widgets in a way that breaks tests specifically looking for calls on a Canvas.

Today, non-Fuchsia platforms handle physical shapes (e.g. a Material widget) that have elevation > 0.0 by drawing a shadow and clipping the canvas, whereas Fuchsia creates a PhysicalModelLayer and lets the engine pass this along to Fuchsia's compositor.

I'd like to change this so that all platforms composite physical shapes in the layer tree.  This would help us make a few things more consistent across multiple platforms, and seems to offer a performance benefit on Android.

This is a breaking change in that the framework will no longer directly make calls to a canvas to draw the shadow or do the clipping.  This will require tests that use a mock canvas to track these things be updated to check the layer tree instead.  I do not believe this breakage will have a large impact, but it is a break nonetheless.

The draft pull request is located here: https://github.com/flutter/flutter/pull/28919

Thanks,

Dan
Reply all
Reply to author
Forward
0 new messages