)]}'
{
  "commit": "92b17db95243a70ad14e3ad962b8bbb7bfda3fe3",
  "tree": "db7e094dc47f9c3f21220a5ea3631e34bdfe7b29",
  "parents": [
    "7b6be5cfa9f3137044ff31d5f36636e69fa0b7bc"
  ],
  "author": {
    "name": "Matan Lurey",
    "email": "matanlurey@users.noreply.github.com",
    "time": "Wed Aug 09 19:14:35 2023 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Aug 09 19:14:35 2023 -0700"
  },
  "message": "[Impeller] Replace Vulkan rotation checks with polling (#44361)\n\ntl;dr: Reverts https://github.com/flutter/engine/pull/43214. closes\r\nhttps://github.com/flutter/flutter/issues/129459.\r\n\r\n\r\n![7v5zfd](https://github.com/flutter/engine/assets/168174/b87a0726-cddd-415e-a46c-2c65d6f5c9d5)\r\n\r\n---\r\n\r\nIn https://github.com/flutter/engine/pull/43214, @jonahwilliams used\r\n`vkQueuePresentKHR`[^1] [to\r\ncheck](https://github.com/jonahwilliams/engine/blob/a0df46add166202fe68a853391d379e69ddc7c18/impeller/renderer/backend/vulkan/swapchain_impl_vk.cc#L465-L467)\r\nif device orientations had changed, and if so, the swap-chain was torn\r\ndown and replaced with a new instance (that would now have a correct\r\nrotation for ... compositing reasons I don\u0027t quite understand).\r\n\r\nUnfortunately `vkQueuePresentKHR` is (a) only present on Android 10+\r\n_and_ (b) ... isn\u0027t implemented consistently across Android devices. For\r\nexample, the popular Samsung Galaxy S10 doesn\u0027t return\r\n`VK_SUBOPTIMAL_KHR`, leading to the same rotation bugs described in\r\nhttps://github.com/flutter/flutter/issues/129459 (i.e. even with\r\nhttps://github.com/flutter/engine/pull/43214).\r\n\r\nThis PR implements the polling technique recommended by Android[^2], in\r\nthis case on every frame. We should expect this to have a performance\r\npenalty of ~`0.2`ms per frame, but should at least give us consistent\r\nfidelity on Vulkan + Android for the time-being.\r\n\r\n\r\n![flutter_04](https://github.com/flutter/engine/assets/168174/969f5c5e-7f6a-4156-8de8-1351b32f2a2f)\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\r\nSome additional screenshots generated while debugging\r\n\u003c/summary\u003e\r\n\u003cimg src\r\n\u003d\"https://github.com/flutter/engine/assets/168174/900e02a8-aa51-4592-9690-c650092130a2\"\r\n/\u003e\r\n\u003cimg\r\nsrc\u003d\"https://github.com/flutter/engine/assets/168174/e7b9e5c0-86b0-407f-aa51-2f76afda4f03)\"\r\n/\u003e\r\n\u003cimg\r\nsrc\u003d\"https://github.com/flutter/engine/assets/168174/6b611090-97f5-4589-9ef9-6ba778efc6b7\"\r\n/\u003e\r\n\u003c/details\u003e\r\n\r\n\r\n[^1]:\r\nhttps://developer.android.com/games/optimize/vulkan-prerotation#detect_device_orientation_changes\r\n[^2]:\r\nhttps://developer.android.com/games/optimize/vulkan-prerotation#using_polling",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fbfaac09a3ddadac67b162c8c34439efbd91da56",
      "old_mode": 33188,
      "old_path": "impeller/renderer/backend/vulkan/swapchain_impl_vk.cc",
      "new_id": "c5058591d1c866b1134192f4fe3e8cf1ad9dea17",
      "new_mode": 33188,
      "new_path": "impeller/renderer/backend/vulkan/swapchain_impl_vk.cc"
    },
    {
      "type": "modify",
      "old_id": "7f061971acc1b5eff0e5ad9c1867521616827b09",
      "old_mode": 33188,
      "old_path": "impeller/renderer/backend/vulkan/swapchain_impl_vk.h",
      "new_id": "cacc6b2494b6b302cf06a6f8b9b72b4403acd9e4",
      "new_mode": 33188,
      "new_path": "impeller/renderer/backend/vulkan/swapchain_impl_vk.h"
    },
    {
      "type": "modify",
      "old_id": "ee958a44003c82d401af734196a938befce6fccd",
      "old_mode": 33188,
      "old_path": "impeller/renderer/backend/vulkan/swapchain_vk.cc",
      "new_id": "0a09a9eb371e05e071388e6dcdc8cb10b6b7711d",
      "new_mode": 33188,
      "new_path": "impeller/renderer/backend/vulkan/swapchain_vk.cc"
    }
  ]
}
