This is the first step in making Flutter aware of and responsive to Z
bound overflow. On its own this patch shouldn't result in any changes in
behavior. This will need to be followed up with a patch in Fuchsia's
Flutter runner to set the Z bounds after this lands, and another patch
in the engine actually implementing the desired overflow behavior.
This Z bound info is routed through the engine itself to make sure the
bounds in flow are truly consistent from the Fuchsia runner. However
these values should eventually be exposed to the framework as well.
Previously the engine was creating multiple `ShapeNode`s all underneath
the same root `EntityNode` at local space z=0. This caused frequent
z-fighting within Flutter layers.
This patch updates the engine to only create one ShapeNode per
EntityNode, which fixes the z-fighting independent of layer elevation.
Z-fighting is still possible from actually setting multiple layers to
the same z in world space using Flutter elevation.
flutter/flutter#25226
Since it's adding to paint_layers_, I think the "painted" is a typo of
"paint". It's also a misleading typo which mistakenly let people believe
that the layer has already been painted.
Compute the necessary texture resolution using more accurate scaling
information provided by Mozart scene node metrics events instead of the
device pixel ratio provided by the Mozart view properties (which we
might remove in the future).
This allows us to allocate smaller textures when a Flutter view is
being scaled down.
This version does not recycle buffers. It is meant only as an initial solution,
and the proper buffer recycling logic has been broken out into a separate change
We push a bit up the tree during preroll to learn whether there system
composited layers below each layer. During update scene, we squash down
to paint tasks, which we execute after publishing the new scene.