flutter/flutter

Decide what parts of the Java embedder rendering APIs to deprecate

matanlurey opened this issue · 0 comments

In Flutter 3.22, we've formally instructed users to stop using the {create|register}SurfaceTexture family of APIs and instead to use createSurfaceProducer, which, as an implementation detail, picks the right Surface-backed implementation. This is due to Impeller using Vulkan on newish Android APIs, and Vulkan not supporting OpenGL-based SurfaceTextures.

The next step in #139702 is deprecate APIs we don't expect users to need or use anymore (as of flutter/engine#52892 we issue error messages on the C++ engine side). For sake of scope, let's focus on io.flutter.view.TextureRegistry and known implementing classes.

Here is my proposal of APIs to deprecate, but I'd like feedback:

P1: Will no longer work in Impeller

We should do this before Impeller becomes the default.

API Action
.SurfaceTextureEntry Deprecate, we want users using SurfaceProducer.
.createSurfaceTexture Deprecate, we want users using SurfaceProducer.
.registerSurfaceTexture Deprecate, we want users using SurfaceProducer.

P2: Unused or no longer useful as part of the public API

These are nice-to-have cleanups, we should do the ones that make sense.

API Action
.GLTextureConsumer Remove. AFAICT this is unused code.
.ImageConsumer Make internal after registerImageTexture is no longer public.
.ImageTextureEntry Make internal after registerImageTexture is no longer public.
.OnFrameConsumedListener Remove or make @VisibleForTesting, 1 usage.
.OnTrimMemoryListener Make internal, used in one place internally only.
.TextureEntry Remove once there is only SurfaceProducer.
.createImageTexture Make internal only, 1 usage internally.
.onTrimMemory Make internal only.

Assigned @jonahwilliams and @johnmccutchan to review while I'm on vacation 😎