From 55d598886f6354e48e5d6801c1197a6007febd44 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Mon, 21 Aug 2023 12:14:00 -0700 Subject: [PATCH] [Impeller] Initial Android Impeller docs on backend selection and platform views. (flutter/engine#44815) Fixes https://github.com/flutter/flutter/issues/132716 --- engine/src/flutter/impeller/docs/android.md | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 engine/src/flutter/impeller/docs/android.md diff --git a/engine/src/flutter/impeller/docs/android.md b/engine/src/flutter/impeller/docs/android.md new file mode 100644 index 0000000000..4003fe6bae --- /dev/null +++ b/engine/src/flutter/impeller/docs/android.md @@ -0,0 +1,34 @@ +# Android + +## Backends + +Android supports both GLES and Vulkan backends for Impeller. + +For Android < 29, Impeller will choose GLES as the backend. +For Android >= 29, Impeller will choose Vulkan as the backend. + +Version 29 provides HardwareBuffer support which is critical in efficiently +supporting Platform Views in Vulkan. + +## Platform Views + +Android Platform Views (i.e. an android.view.View embedded inside a Flutter app) +are supported in both GLES and Vulkan backends and the Engine manages this +automatically. + +## SurfaceTexture + +Flutter's Java API allows for developers to register custom SurfaceTexture +backed textures that can be rendered inside of a Flutter application. See +`TextureRegistry.registerSurfaceTexture` and `TextureRegistry.createSurfaceTexture`. + +### GLES + +There are no issues with SurfaceTextures when using the GLES backend. + +### Vulkan + +We do not currently support rendering these textures when using the Vulkan +backend. Supporting this will require adding support for importing GL textures +into Vulkan textures which will have performance implications. +