diff --git a/flow/layers/opacity_layer.h b/flow/layers/opacity_layer.h index e437041c21f..93f73988d9e 100644 --- a/flow/layers/opacity_layer.h +++ b/flow/layers/opacity_layer.h @@ -9,6 +9,10 @@ namespace flutter { +// Don't add an OpacityLayer with no children to the layer tree. Painting an +// OpacityLayer is very costly due to the saveLayer call. If there's no child, +// having the OpacityLayer or not has the same effect. In debug_unopt build, the +// |EnsureSingleChild| will assert if there are no children. class OpacityLayer : public ContainerLayer { public: OpacityLayer();