Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how OpenGL textures are flipped in the Android embedder. #49938

Merged

Conversation

matanlurey
Copy link
Contributor

@matanlurey matanlurey commented Jan 22, 2024

h/t @bdero for writing the actual code (I just wrote comments).

Manual test1 of cd packages/packages/video_player/video_player/example && flutter run:

Skia

Screenshot 2024-01-22 at 3 21 20 PM

Impeller + OpenGL

Screenshot 2024-01-22 at 9 41 59 AM

<meta-data
      android:name="io.flutter.embedding.android.EnableImpeller"
      android:value="true" />
<meta-data
      android:name="io.flutter.embedding.android.ImpellerBackend"
      android:value="opengles" />

Closes flutter/flutter#141636.

Footnotes

  1. I can't write a test worth writing at the same time of this PR, so I've filed https://github.com/flutter/flutter/issues/141973 to do it after.

Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM

@johnmccutchan
Copy link
Contributor

test-exempt: Test will live in another repo

@bdero
Copy link
Member

bdero commented Jan 22, 2024

@matanlurey This patch is correct, but it turns out there's also a bug in surface_texture_external_texture_gl.cc for Skia's mapping that we need to patch in here: flutter/flutter#141636 (comment)

@matanlurey matanlurey marked this pull request as ready for review January 22, 2024 23:24
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@matanlurey matanlurey merged commit 37f68f6 into flutter:main Jan 23, 2024
27 checks passed
@matanlurey matanlurey deleted the engine-android-SurfaceTextureRenderBug branch January 23, 2024 00:52
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 23, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 23, 2024
…142027)

flutter/engine@9e582c9...37f68f6

2024-01-23 matanlurey@users.noreply.github.com Change how OpenGL textures are flipped in the Android embedder. (flutter/engine#49938)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jonahwilliams@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Jan 23, 2024
Document some confusing bits of `geometry` for the next bub.

Originally this PR was to add a test and fix a bug, but that's being handled here: #49938.
matanlurey added a commit to matanlurey/engine that referenced this pull request Jan 29, 2024
matanlurey added a commit that referenced this pull request Jan 30, 2024
…er" (#50158)

Reverts #49938.

This broke `packages/packages/camera/camera/example`, and unfortunately
there is no test (in engine, framework, or packages) that would have
caught this. We also suspect (but are not sure) that this is related to
an internal customer reported bug as well (b/322750489).

---

Here is the output _pre_-revert:


![image](https://github.com/flutter/engine/assets/168174/0691feec-67a9-45b1-aa8e-1c692d09430b)

Here is the output _post_-revert:


![image](https://github.com/flutter/engine/assets/168174/016dc79a-1e44-48cf-9ba0-a61397f8e637)
CaseyHillers pushed a commit to CaseyHillers/engine that referenced this pull request Jan 30, 2024
…er" (flutter#50158)

Reverts flutter#49938.

This broke `packages/packages/camera/camera/example`, and unfortunately
there is no test (in engine, framework, or packages) that would have
caught this. We also suspect (but are not sure) that this is related to
an internal customer reported bug as well (b/322750489).

---

Here is the output _pre_-revert:


![image](https://github.com/flutter/engine/assets/168174/0691feec-67a9-45b1-aa8e-1c692d09430b)

Here is the output _post_-revert:


![image](https://github.com/flutter/engine/assets/168174/016dc79a-1e44-48cf-9ba0-a61397f8e637)
auto-submit bot pushed a commit that referenced this pull request Jan 30, 2024
…mbedder" (#50176)

(#50158)

b/322916882

Reverts #49938.

This broke `packages/packages/camera/camera/example`, and unfortunately there is no test (in engine, framework, or packages) that would have caught this. We also suspect (but are not sure) that this is related to an internal customer reported bug as well (b/322750489).

---

Here is the output _pre_-revert:

![image](https://github.com/flutter/engine/assets/168174/0691feec-67a9-45b1-aa8e-1c692d09430b)

Here is the output _post_-revert:

![image](https://github.com/flutter/engine/assets/168174/016dc79a-1e44-48cf-9ba0-a61397f8e637)
matanlurey added a commit that referenced this pull request Feb 7, 2024
20337ea
(now reverted) intentionally re-introduced a bug
(#49938) on a now working test
runner, and verified that (with some fixes in this PR), we can now catch
regressions on CI with SkiaGold:

---

<details>

<summary>ExternalTextureTests_testCanvasSurface.png</summary>

This test shows that what previously was a picture has been reduced down
to a single stretched pixel.

**BEFORE**:


![ExternalTextureTests_testCanvasSurface](https://github.com/flutter/engine/assets/168174/1509ea21-2887-4a3b-b200-b857bbfb8304)

**AFTER**:


![ExternalTextureTests_testCanvasSurface](https://github.com/flutter/engine/assets/168174/d9ae19c8-dd39-4e7f-859c-5d82bd1ba0a3)

</details>

<details>

<summary>ExternalTextureTests_testRotatedMediaSurface_180.png</summary>

Similar to above, but shows _another_ bug (kClamp versus kRepeat)

**BEFORE**:


![ExternalTextureTests_testRotatedMediaSurface_180](https://github.com/flutter/engine/assets/168174/fee5bc8d-749f-4a59-976a-a573515fecea)

**AFTER**:


![ExternalTextureTests_testRotatedMediaSurface_180](https://github.com/flutter/engine/assets/168174/a5249f70-22b4-4d36-8b63-e88c8a6846fe)/cc

</details>

---

This PR now makes the `scenario_test` useful and blocking for Android
engine rolls:

- Add support for connecting to SkiaGold by depending on `goldctl` in
the appropriate configs.
- Add some useful local debugging flags for skipping SkiaGold or running
specific tests (not used by default).
- Failing to connect to Skia gold is now a test failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Impeller] SurfaceTextures created by some critical plugins do not render in OpenGL.
4 participants