)]}'
{
  "commit": "e33f3b4c8a6a5b884c829dd7a5e92a09af1556c9",
  "tree": "d43f55dec36a7181479434aaa118460f9d9a63c1",
  "parents": [
    "3771ca9fd50901b789ce6c8118f82619f7470ac4"
  ],
  "author": {
    "name": "Brandon DeRosier",
    "email": "bdero@google.com",
    "time": "Sat Jan 27 19:59:21 2024 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun Jan 28 03:59:21 2024 +0000"
  },
  "message": "[Impeller] Fix alpha management issues for advanced blends. (#50070)\n\nResolves https://github.com/flutter/flutter/issues/140970.\r\n\r\nThe issue is easy to miss in the goldens if you don\u0027t know what to look for, but it was always present in one way or another. In the \"before\" image below, we end up removing some of the backdrop alpha as a result of the blend, which should never happen with an advanced blend:\r\n\r\n\u003cimg width\u003d\"171\" alt\u003d\"image\" src\u003d\"https://github.com/flutter/engine/assets/919017/b0ac7c00-fba7-4c86-82c9-94b99ea400e3\"\u003e\r\n\r\nThis was happening because we were lerping towards the original source alpha from the destination alpha. So in the sad smiley case, the RGB getting written to the framebuffer was exactly correct, but the alpha would end up being less than 1, which the window manager then blends against the black-initialized framebuffer.\r\n\r\nBlending with the black background just so happened to perfectly match the appearance of the color being double-premultiplied, which is why increasing the source color\u0027s vibrancy by unpremultiplying also looks correct. But again, that only works iff the pass texture winds up being drawn to a black background, which is a rare case for offscreen passes.\r\n\r\nSkia (Flutter documentation):\r\n![image](https://github.com/flutter/engine/assets/919017/aeb2a7cf-50a4-460d-9247-054a86833018)\r\n\r\nImpeller before:\r\n\u003cimg width\u003d\"398\" alt\u003d\"image\" src\u003d\"https://github.com/flutter/engine/assets/919017/fda958c5-1bd6-4272-a2b4-f8e25c42cb2f\"\u003e\r\n\r\nImpeller after:\r\n\u003cimg width\u003d\"398\" alt\u003d\"image\" src\u003d\"https://github.com/flutter/engine/assets/919017/a4ca51f8-c287-4e27-9979-44b1c91302b2\"\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b8ace127462c5d25213c62eabc94ee2a2567f9c2",
      "old_mode": 33188,
      "old_path": "impeller/aiks/aiks_unittests.cc",
      "new_id": "a40c1e0728b4619bf31914dc6126d135e545afe9",
      "new_mode": 33188,
      "new_path": "impeller/aiks/aiks_unittests.cc"
    },
    {
      "type": "modify",
      "old_id": "dc2fd1382705ea091e848bd6c2944c55c85caa5c",
      "old_mode": 33188,
      "old_path": "impeller/compiler/shader_lib/impeller/blending.glsl",
      "new_id": "59352f2bd22d208f2cbcf2216bd79d03d872e4eb",
      "new_mode": 33188,
      "new_path": "impeller/compiler/shader_lib/impeller/blending.glsl"
    },
    {
      "type": "modify",
      "old_id": "b15c5db7fe06dc3bbea99e22f8f7b9d9ca0ac0e1",
      "old_mode": 33188,
      "old_path": "impeller/entity/shaders/blending/advanced_blend.frag",
      "new_id": "0e7f80958ccac19375e186a2c54d23405b95e4b6",
      "new_mode": 33188,
      "new_path": "impeller/entity/shaders/blending/advanced_blend.frag"
    },
    {
      "type": "modify",
      "old_id": "58cedbd56b4c0e47b0075cc1ec05f45a468df7c0",
      "old_mode": 33188,
      "old_path": "impeller/entity/shaders/blending/framebuffer_blend.frag",
      "new_id": "095d5e5bd66d08a22cd442bc4c9e6f090074f479",
      "new_mode": 33188,
      "new_path": "impeller/entity/shaders/blending/framebuffer_blend.frag"
    },
    {
      "type": "modify",
      "old_id": "2efe123c906f48f3243fcbd2e798e853d04f967a",
      "old_mode": 33188,
      "old_path": "impeller/geometry/color.cc",
      "new_id": "d2565e6e6fd1dd7b9baa60a108926e6b1d4a79a9",
      "new_mode": 33188,
      "new_path": "impeller/geometry/color.cc"
    },
    {
      "type": "modify",
      "old_id": "6b7f6951c850214e4574de0cb377016dcaf40954",
      "old_mode": 33188,
      "old_path": "impeller/geometry/geometry_unittests.cc",
      "new_id": "d9df8d1bf08932f4b8235f5fa3fc0a1aee0c2532",
      "new_mode": 33188,
      "new_path": "impeller/geometry/geometry_unittests.cc"
    },
    {
      "type": "modify",
      "old_id": "377fe50b82df95612f5445dc511df39a784e3ada",
      "old_mode": 33188,
      "old_path": "impeller/tools/malioc.json",
      "new_id": "8cf4183c4f6ac415bf5d56f76a7acb909d667662",
      "new_mode": 33188,
      "new_path": "impeller/tools/malioc.json"
    }
  ]
}
