Jason Simmons 9a8367da7e Do not paint a layer's children if the children were not prerolled (flutter/engine#14149)
Prerolling a layer can have side effects.  In particular, PlatformViewLayer::Preroll
will call view_embedder->PrerollCompositeEmbeddedView.

Clip layers will check whether the layer's children are all clipped and if so
will skip calling Preroll on the children.  However, the Paint implementation in
these layers was always calling Paint on their children.

This could result in a call to PlatformViewLayer::Paint without a corresponding
call to PlatformViewLayer::Preroll.  This translates to a CompositeEmbeddedView
call without a PrerollCompositeEmbeddedView call on the affected view_id.
The EmbedderExternalViewEmbedder implementation does not allow that.

With this change, clip layers will only call PaintChildren if the preroll
called PrerollChildren.

See https://github.com/flutter/flutter/issues/46111
2019-12-05 16:25:55 -08:00
..