)]}'
{
  "commit": "b07acf9bb92f104596639b433bdc0fc3957a1b5c",
  "tree": "bc7c5879ae20d85af8d38462539fe7d93987c515",
  "parents": [
    "cefc5935b618f02a18d342bcebf5a09139c01c49"
  ],
  "author": {
    "name": "b-luk",
    "email": "97480502+b-luk@users.noreply.github.com",
    "time": "Tue Mar 10 17:12:59 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Mar 11 00:12:59 2026 +0000"
  },
  "message": "Add GLES support for the same pixel formats for copying texture -\u003e buffer as when copying buffer -\u003e texture (#183428)\n\n`BlitCopyBufferToTextureCommandGLES` (and initializing/setting texture\ncontents in `TextureGLES`) supports a bunch of different pixel formats,\nas defined in the `TexImage2DData` constructors in\n`blit_command_gles.cc` and `texture_gles.cc`.\n\nBut `BlitCopyTextureToBufferCommandGLES` only has support specifically\nfor `kR8G8B8A8UNormInt` and `kB8G8R8A8UNormInt`.\n\nThis makes `BlitCopyTextureToBufferCommandGLES` support the same pixel\nformats as `BlitCopyBufferToTextureCommandGLES` and `TextureGLES`.\n\nFixes https://github.com/flutter/flutter/issues/183462\n\n## Changes:\n\n### Share `ToPixelFormatGLES`\n\n`blit_command_gles.cc` and `texture_gles.cc` have almost-duplicate logic\nto convert `impeller::PixelFormat` to a `GLint internal_format`, a\n`GLenum external_format`, and a `GLenum type`. Factor this out into a\nshared `ToPixelFormatGLES` function in `formats_gles.h/cc`.\n\nWhere there were differences between the `blit_command_gles.cc` and\n`texture_gles.cc`:\n- `kR32G32B32A32Float`:\n- `blit_command_gles.cc` has `internal_format \u003d GL_RGBA`,\n`external_format \u003d GL_RGBA`\n- `texture_gles.cc` has `internal_format \u003d GL_RGBA32F`, `external_format\n\u003d GL_RGBA`\n  - I used `internal_format \u003d GL_RGBA32F`, `external_format \u003d GL_RGBA`\n- `kR16G16B16A16Float`:\n- `blit_command_gles.cc` has `internal_format \u003d GL_RGBA`,\n`external_format \u003d GL_RGBA`\n- `texture_gles.cc` has `internal_format \u003d GL_RGBA16F`, `external_format\n\u003d GL_RGBA`\n  - I used `internal_format \u003d GL_RGBA16F`, `external_format \u003d GL_RGBA`\n- `kR32Float`:\n- `blit_command_gles.cc` has `internal_format \u003d GL_RED`,\n`external_format \u003d GL_RED`\n- `texture_gles.cc` has `internal_format \u003d GL_R32F`, `external_format \u003d\nGL_RGBA`\n  - I used `internal_format \u003d GL_R32F`, `external_format \u003d GL_RED`\n\nAll the other PixelFormat cases were the same between the two files and\ncopied over directly.\n\n### Remove `TexImage2DData`\n\n`blit_command_gles.cc` and `texture_gles.cc` each define a\n`TexImage2DData` struct which just contains the pixel format data and\nsometimes an optional data buffer. I removed both of these. Instead, we\njust use the `ToPixelFormatGLES` return value directly, and use the\nsource data buffer directly.\n\n### Improve pixel format support in\n`BlitCopyTextureToBufferCommandGLES::Encode()`\n\nIn `BlitCopyTextureToBufferCommandGLES::Encode()`, use\n`ToPixelFormatGLES()` to determine the format and type used for\n`gl.ReadPixels()`. This expands the existing functionality that only\nsupported two specific pixel formats.\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant documentation (doc comments with `///`).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [x] All existing and new tests are passing.\n\nIf you need help, consider asking for advice on the #hackers-new channel\non [Discord].\n\n**Note**: The Flutter team is currently trialing the use of [Gemini Code\nAssist for\nGitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).\nComments from the `gemini-code-assist` bot should not be taken as\nauthoritative feedback from the Flutter team. If you find its comments\nuseful you can update your code accordingly, but if you are unsure or\ndisagree with the feedback, please feel free to wait for a Flutter team\nmember\u0027s review for guidance on which automated comments should be\naddressed.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[AI contribution guidelines]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[flutter/tests]: https://github.com/flutter/tests\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Discord]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "64464f400c3b40fd2a2eba125266f0c1e7132724",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/impeller/renderer/backend/gles/blit_command_gles.cc",
      "new_id": "45ad9ce6b1bf10acdab74eeda8fe593bc82ffe5e",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/impeller/renderer/backend/gles/blit_command_gles.cc"
    },
    {
      "type": "modify",
      "old_id": "4f8ba7623d266354ac7e61ba63aa6aabeb12d1c8",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/impeller/renderer/backend/gles/blit_command_gles_unittests.cc",
      "new_id": "8848944ae671c0fdfa83e7da8ee4473d9a334808",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/impeller/renderer/backend/gles/blit_command_gles_unittests.cc"
    },
    {
      "type": "modify",
      "old_id": "0f8b719b40869418e541a6a9aced2d5a136d87e8",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/impeller/renderer/backend/gles/formats_gles.cc",
      "new_id": "23b9484ede2e115fe22109faf18725a5d1e272fd",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/impeller/renderer/backend/gles/formats_gles.cc"
    },
    {
      "type": "modify",
      "old_id": "9b3c9ff82906773db1d89ed8debf48e78730bb63",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/impeller/renderer/backend/gles/formats_gles.h",
      "new_id": "f6c50bfd4abe5cb290a6eb4573f01bc1b4c9b613",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/impeller/renderer/backend/gles/formats_gles.h"
    },
    {
      "type": "modify",
      "old_id": "4454e5f68a02d22bfea3349ca4b28938bc6fdd29",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/impeller/renderer/backend/gles/texture_gles.cc",
      "new_id": "531948ff8cfed33e050620a286faad9429ea07d8",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/impeller/renderer/backend/gles/texture_gles.cc"
    },
    {
      "type": "modify",
      "old_id": "7211ce778fffb218cf9c8c02cb7569fb37dd0fc4",
      "old_mode": 33261,
      "old_path": "engine/src/flutter/testing/run_tests.py",
      "new_id": "272529add4242b4c6673fd1d55796f8346ed7ab5",
      "new_mode": 33261,
      "new_path": "engine/src/flutter/testing/run_tests.py"
    }
  ]
}
