Fixes https://github.com/flutter/flutter/issues/130775
On the Skia backend, antiAliasWithSaveLayer is the highest fidelity clipping option. In the Impeller backend, there isn't any difference in how we clip, since the stencil buffer is always used. Nevertheless we were still inserting the save layer, which results in an extra offscreen texture and is wasteful.
Track if impeller is enabled in the diff/preroll/paint context and avoid inserting a save layer.
Removes the physical model layer and associated engine code. This was already deprecated and removed in the framework. By removing it in the engine, we can also remove the need for layer tree diff/paint/preroll to have the device pixel ratio. This will simplify some of the multi-view work
Fixes https://github.com/flutter/flutter/issues/125720
This has been originally added to account for different
parts of rendering process applying integer CTM inconsistently. With Integer CTM removed this is dead code.
* Take SUPPORT_FRACTIONAL_TRANSLATION into account when diffing layers
* Store cull_rect in device coordinates
This removes the need to update cull rect coordinates when overriding transform
and is also consistent with how Layer::needs_painting() works.
* Use original transform for culling, but overriden transform to get paint coordinates.
This is to replicate the paint process during diffing, where layers are culled first and only then after paint the matrix is overriden.
* Rewrite AddLayerBounds based on @flar's suggestions