Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[CP][Windows] Improve texture format logic#54517

Merged
auto-submit[bot] merged 1 commit into
flutter-team-archive:flutter-3.24-candidate.0from
loic-sharma:cp_windows_texture_format
Aug 13, 2024
Merged

[CP][Windows] Improve texture format logic#54517
auto-submit[bot] merged 1 commit into
flutter-team-archive:flutter-3.24-candidate.0from
loic-sharma:cp_windows_texture_format

Conversation

@loic-sharma

@loic-sharma loic-sharma commented Aug 12, 2024

Copy link
Copy Markdown
Contributor

This improves Flutter Window's texture format logic:

1. **If the device has extension `GL_EXT_texture_format_BGRA8888`**: backing stores' texture will be created with format `GL_BGRA_EXT` instead of `GL_RGBA8`. This is what fixes flutter/flutter#150546.
2. **Otherwise**: backing stores' texture will be created with format `GL_RGBA` and the engine will use the color type `kRGBA_8888_SkColorType` when creating the `SkSurface`.

   Previously the engine always used color type `kN32_SkColorType`, which could be either RGBA or BGRA depending on the machine that compiled the engine. This caused Skia validation errors as the texture's format did not match the Skia surface's color type.

   I tested this by editing Flutter Windows to force it down this code path.

Huge kudos to @chinmaygarde for the OpenGL expertise!

Fixes: flutter/flutter#150546

> [!WARNING]
> Unfortunately, we are unable to test this.
> This bug appears to only affect older devices; none of our devices reproduce this issue.
> We also do not have the infrastructure to do a native screenshot test on Windows.
> I will get a test exemption for this change.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@itsjustkevin itsjustkevin added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2024
@auto-submit auto-submit Bot merged commit e72f0c3 into flutter-team-archive:flutter-3.24-candidate.0 Aug 13, 2024

@cbracken cbracken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-windows

Development

Successfully merging this pull request may close these issues.

3 participants