Document that OpacityLayer's children are nonempty (flutter/engine#8707)

See https://github.com/flutter/flutter/issues/31517
This commit is contained in:
liyuqian 2019-04-23 15:02:57 -07:00 committed by GitHub
parent 0163a0e8dc
commit 39e920cd1a

View File

@ -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();