Reland again "Remove layer integral offset snapping #17112" (#18160)
This reverts commit a7a25d3b and relands our reland https://github.com/flutter/engine/pull/17915. Additionally, we fixed the cull rect logic in `OpacityLayer::Preroll` which is the root cause of https://github.com/flutter/flutter/issues/56298. We've always had that root problem before but it did not trigger performance issues because we were using the OpacityLayer's `paint_bounds`, instead of its child's `paint_bounds` for preparing the layer raster cache. A correct handling of the cull rect should allow us to cull at any level. It also turns out that our ios32 (iPhone4s) performacne can regress a lot without snapping. My theory is that although the picture has a fractional top left corner, many drawing operations inside the picture have integral coordinations. In older hardwares, keeping those coordinates integral seems to be performance critical. To avoid flutter/flutter#41654, the snapping will still be disabled if the matrix has non-scale-translation transformations.
Showing
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_background_foreground_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_background_foreground_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_background_foreground_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_background_foreground_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_background_foreground_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_background_foreground_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_rotate_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_rotate_iPhone%208_simulator.png)
| W: | H:
| W: | H:
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_rotate_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_rotate_iPhone%208_simulator.png)
![testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_rotate_iPhone 8_simulator.png](https://gitcode.net/sxychenjing/engine/-/raw/5e361f57dcefbc738ffabb4d775b350662b736d0/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_rotate_iPhone%208_simulator.png)