839d63312cd434238e00c056690780b1980d4970
tl;dr: Reverts https://github.com/flutter/engine/pull/43214. closes
https://github.com/flutter/flutter/issues/129459.

---
In https://github.com/flutter/engine/pull/43214, @jonahwilliams used
`vkQueuePresentKHR`[^1] [to
check](a0df46add1/impeller/renderer/backend/vulkan/swapchain_impl_vk.cc (L465-L467))
if device orientations had changed, and if so, the swap-chain was torn
down and replaced with a new instance (that would now have a correct
rotation for ... compositing reasons I don't quite understand).
Unfortunately `vkQueuePresentKHR` is (a) only present on Android 10+
_and_ (b) ... isn't implemented consistently across Android devices. For
example, the popular Samsung Galaxy S10 doesn't return
`VK_SUBOPTIMAL_KHR`, leading to the same rotation bugs described in
https://github.com/flutter/flutter/issues/129459 (i.e. even with
https://github.com/flutter/engine/pull/43214).
This PR implements the polling technique recommended by Android[^2], in
this case on every frame. We should expect this to have a performance
penalty of ~`0.2`ms per frame, but should at least give us consistent
fidelity on Vulkan + Android for the time-being.

<details>
<summary>
Some additional screenshots generated while debugging
</summary>
<img src
="https://github.com/flutter/engine/assets/168174/900e02a8-aa51-4592-9690-c650092130a2"
/>
<img
src="https://github.com/flutter/engine/assets/168174/e7b9e5c0-86b0-407f-aa51-2f76afda4f03)"
/>
<img
src="https://github.com/flutter/engine/assets/168174/6b611090-97f5-4589-9ef9-6ba778efc6b7"
/>
</details>
[^1]:
https://developer.android.com/games/optimize/vulkan-prerotation#detect_device_orientation_changes
[^2]:
https://developer.android.com/games/optimize/vulkan-prerotation#using_polling
Description
Languages
Dart
75.4%
C++
16.4%
Objective-C++
2.7%
Java
2.7%
Objective-C
0.6%
Other
1.8%