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

[Impeller] Support for rendering Android Platform Views into a HardwareBuffer backed texture. #44087

Merged

Conversation

johnmccutchan
Copy link
Contributor

@johnmccutchan johnmccutchan commented Jul 27, 2023

  • Introduce TextureRegistry.ImageTexture and related machinery.
  • Introduce ImageReaderPlatformViewRenderTarget.
  • Introduce HardwareBufferExternalTextureGL and related machinery.

NOTE: ImageReaderPlatformViewRenderTarget requires Android 26.

NOTE: This CL does not enable using ImageReaderPlatformViewRenderTarget yet.

Related flutter/flutter#130892

@chinmaygarde chinmaygarde changed the title Support for rendering Android Platform Views into a HardwareBuffer backed texture [Impeller] Support for rendering Android Platform Views into a HardwareBuffer backed texture. Jul 28, 2023
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Mostly just nits and references to existing utilities that may come in handy.


// API Version 26
static bool HardwareBufferSupported();
static AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere, please prefer PascalCase. So AHardwareBufferFromJavaHardwareBuffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The names are coming directly from the NDK which will make searching for usage simple. Let me know if you feel strongly about rewriting these names here.

Copy link
Member

Choose a reason for hiding this comment

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

No. No strong opinions. Seem like a good reason to break convention.

@johnmccutchan
Copy link
Contributor Author

Thanks for the review!

@johnmccutchan johnmccutchan force-pushed the hardwarebuffer_platformview branch 4 times, most recently from 9748d2a to ee132ce Compare August 1, 2023 18:17
@johnmccutchan johnmccutchan force-pushed the hardwarebuffer_platformview branch 2 times, most recently from b0a650a to e4cf13d Compare August 1, 2023 19:53
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you for reading through the nitpicks :)


// Simple holder of an EGLImage and the owning EGLDisplay.
struct EGLImageWithDisplay {
EGLImage image;
Copy link
Member

Choose a reason for hiding this comment

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

Please default these to EGL_NO_IMAGE and EGL_NO_DISPLAY

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch.

Done.


// API Version 26
static bool HardwareBufferSupported();
static AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(
Copy link
Member

Choose a reason for hiding this comment

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

No. No strong opinions. Seem like a good reason to break convention.

@johnmccutchan johnmccutchan force-pushed the hardwarebuffer_platformview branch from e4cf13d to 76e91a9 Compare August 1, 2023 20:56
…ureGL

- Introduce TextureRegistry.ImageTexture and related machinery.
- Introduce HardwareBufferExternalTextureGL and related machinery.
- Introduce ImageReaderPlatformViewRenderTarget.

NOTE: ImageReaderPlatformViewRenderTarget requires Android 26.

NOTE: This CL does not enable using ImageReaderPlatformViewRenderTarget yet.
@johnmccutchan johnmccutchan force-pushed the hardwarebuffer_platformview branch from 76e91a9 to 4d4a6bd Compare August 1, 2023 21:24
@johnmccutchan johnmccutchan merged commit 1397257 into flutter:main Aug 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
zanderso added a commit that referenced this pull request Aug 2, 2023
…a HardwareBuffer backed texture. (#44087)"

This reverts commit 1397257.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
zanderso added a commit that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 2, 2023
…sions) (#131785)

Manual roll requested by jacksongardner@google.com

flutter/engine@9dae7b7...d6b962d

2023-08-02 zanderso@users.noreply.github.com Revert "[Impeller] Support for rendering Android Platform Views into a HardwareBuffer backed texture." (flutter/engine#44262)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from c6577d328585 to 6009cc6d7d80 (2 revisions) (flutter/engine#44264)
2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from 11cef17b53ac to d61a50c155bd (1 revision) (flutter/engine#44261)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 1c0bba7c1053 to c6577d328585 (2 revisions) (flutter/engine#44260)
2023-08-02 skia-flutter-autoroll@skia.org Roll Dart SDK from 8ff03ebf7eaa to afbaf4216fc8 (1 revision) (flutter/engine#44259)
2023-08-02 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 3JSF6hXLRdAK1wUN1... to Hx7ap5qcoqRIknnnG... (flutter/engine#44258)
2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from a21631c02e45 to 11cef17b53ac (1 revision) (flutter/engine#44256)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6807d8b8a9d3 to 1c0bba7c1053 (1 revision) (flutter/engine#44255)
2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from 5d4b3645d0dc to a21631c02e45 (1 revision) (flutter/engine#44252)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6087a5224c6f to 6807d8b8a9d3 (2 revisions) (flutter/engine#44250)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6cb888889ad8 to 6087a5224c6f (1 revision) (flutter/engine#44249)
2023-08-02 jonahwilliams@google.com [Impeller] Give a fixed timeout for acquireNextImageKHR. (flutter/engine#44241)
2023-08-02 skia-flutter-autoroll@skia.org Roll Dart SDK from 7c03426705da to 8ff03ebf7eaa (2 revisions) (flutter/engine#44243)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 4deae93198f9 to 6cb888889ad8 (1 revision) (flutter/engine#44240)
2023-08-01 hterkelsen@users.noreply.github.com [canvaskit] Enable CanvasKit to compute tight SkPicture bounds (flutter/engine#43361)
2023-08-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 197fc0d7fea2 to 7c03426705da (2 revisions) (flutter/engine#44237)
2023-08-01 john@johnmccutchan.com [Impeller] Support for rendering Android Platform Views into a HardwareBuffer backed texture. (flutter/engine#44087)
2023-08-01 yjbanov@google.com [web:a11y] add platform view role (flutter/engine#44188)
2023-08-01 skia-flutter-autoroll@skia.org Roll Skia from 18cf818e044f to 4deae93198f9 (1 revision) (flutter/engine#44236)
2023-08-01 skia-flutter-autoroll@skia.org Roll Skia from 58c031441cbb to 18cf818e044f (6 revisions) (flutter/engine#44234)
2023-08-01 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from g0dgOL2IlZQJCK4El... to 3JSF6hXLRdAK1wUN1... (flutter/engine#44233)
2023-08-01 skia-flutter-autoroll@skia.org Roll ANGLE from b53d99d87e6a to 5d4b3645d0dc (1 revision) (flutter/engine#44231)
2023-08-01 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lwCo6le6r0X-Srvx3... to KPSWBhOvG6piddBQG... (flutter/engine#44230)
2023-08-01 skia-flutter-autoroll@skia.org Roll Skia from d53f7b880651 to 58c031441cbb (2 revisions) (flutter/engine#44229)
2023-08-01 58529443+srujzs@users.noreply.github.com Remove extends JSTypedArray from JSUint8Array1 (flutter/engine#44175)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from lwCo6le6r0X- to KPSWBhOvG6pi
  fuchsia/sdk/core/mac-amd64 from g0dgOL2IlZQJ to Hx7ap5qcoqRI

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 jacksongardner@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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2023
vashworth pushed a commit to vashworth/flutter that referenced this pull request Aug 2, 2023
…sions) (flutter#131785)

Manual roll requested by jacksongardner@google.com

flutter/engine@9dae7b7...d6b962d

2023-08-02 zanderso@users.noreply.github.com Revert "[Impeller] Support for rendering Android Platform Views into a HardwareBuffer backed texture." (flutter/engine#44262)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from c6577d328585 to 6009cc6d7d80 (2 revisions) (flutter/engine#44264)
2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from 11cef17b53ac to d61a50c155bd (1 revision) (flutter/engine#44261)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 1c0bba7c1053 to c6577d328585 (2 revisions) (flutter/engine#44260)
2023-08-02 skia-flutter-autoroll@skia.org Roll Dart SDK from 8ff03ebf7eaa to afbaf4216fc8 (1 revision) (flutter/engine#44259)
2023-08-02 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 3JSF6hXLRdAK1wUN1... to Hx7ap5qcoqRIknnnG... (flutter/engine#44258)
2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from a21631c02e45 to 11cef17b53ac (1 revision) (flutter/engine#44256)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6807d8b8a9d3 to 1c0bba7c1053 (1 revision) (flutter/engine#44255)
2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from 5d4b3645d0dc to a21631c02e45 (1 revision) (flutter/engine#44252)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6087a5224c6f to 6807d8b8a9d3 (2 revisions) (flutter/engine#44250)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6cb888889ad8 to 6087a5224c6f (1 revision) (flutter/engine#44249)
2023-08-02 jonahwilliams@google.com [Impeller] Give a fixed timeout for acquireNextImageKHR. (flutter/engine#44241)
2023-08-02 skia-flutter-autoroll@skia.org Roll Dart SDK from 7c03426705da to 8ff03ebf7eaa (2 revisions) (flutter/engine#44243)
2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 4deae93198f9 to 6cb888889ad8 (1 revision) (flutter/engine#44240)
2023-08-01 hterkelsen@users.noreply.github.com [canvaskit] Enable CanvasKit to compute tight SkPicture bounds (flutter/engine#43361)
2023-08-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 197fc0d7fea2 to 7c03426705da (2 revisions) (flutter/engine#44237)
2023-08-01 john@johnmccutchan.com [Impeller] Support for rendering Android Platform Views into a HardwareBuffer backed texture. (flutter/engine#44087)
2023-08-01 yjbanov@google.com [web:a11y] add platform view role (flutter/engine#44188)
2023-08-01 skia-flutter-autoroll@skia.org Roll Skia from 18cf818e044f to 4deae93198f9 (1 revision) (flutter/engine#44236)
2023-08-01 skia-flutter-autoroll@skia.org Roll Skia from 58c031441cbb to 18cf818e044f (6 revisions) (flutter/engine#44234)
2023-08-01 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from g0dgOL2IlZQJCK4El... to 3JSF6hXLRdAK1wUN1... (flutter/engine#44233)
2023-08-01 skia-flutter-autoroll@skia.org Roll ANGLE from b53d99d87e6a to 5d4b3645d0dc (1 revision) (flutter/engine#44231)
2023-08-01 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lwCo6le6r0X-Srvx3... to KPSWBhOvG6piddBQG... (flutter/engine#44230)
2023-08-01 skia-flutter-autoroll@skia.org Roll Skia from d53f7b880651 to 58c031441cbb (2 revisions) (flutter/engine#44229)
2023-08-01 58529443+srujzs@users.noreply.github.com Remove extends JSTypedArray from JSUint8Array1 (flutter/engine#44175)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from lwCo6le6r0X- to KPSWBhOvG6pi
  fuchsia/sdk/core/mac-amd64 from g0dgOL2IlZQJ to Hx7ap5qcoqRI

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 jacksongardner@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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…reBuffer backed texture. (flutter#44087)

- Introduce TextureRegistry.ImageTexture and related machinery.
- Introduce ImageReaderPlatformViewRenderTarget.
- Introduce HardwareBufferExternalTextureGL and related machinery.

NOTE: ImageReaderPlatformViewRenderTarget requires Android 26.

NOTE: This CL does not enable using ImageReaderPlatformViewRenderTarget
yet.

Related flutter/flutter#130892
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants