Repository: flutter
Issue: Decide what parts of the Java embedder rendering APIs to deprecate
Labels: platform-android,c: proposal,P2,c: tech-debt,team-engine,triaged-engine

In Flutter 3.22, [we've formally instructed users](https://docs.flutter.dev/release/breaking-changes/android-surface-plugins) 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 `SurfaceTexture`s.

The next step in https://github.com/flutter/flutter/issues/139702 is deprecate APIs we don't expect users to need or use anymore (as of https://github.com/flutter/engine/pull/52892 we issue error messages on the C++ engine side). For sake of scope, let's focus on [`io.flutter.view.TextureRegistry`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.html) 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`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.SurfaceTextureEntry.html) | Deprecate, we want users using `SurfaceProducer`.
[`.createSurfaceTexture`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.html#createSurfaceTexture()) | Deprecate, we want users using `SurfaceProducer`.
[`.registerSurfaceTexture`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.html#registerSurfaceTexture(android.graphics.SurfaceTexture)) | 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`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.GLTextureConsumer.html) | Remove. AFAICT this is [unused code](https://github.com/search?q=repo%3Aflutter%2Fengine%20%22GLTextureConsumer%22&type=code).
[`.ImageConsumer`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.ImageConsumer.html) | Make internal after `registerImageTexture` is no longer public.
[`.ImageTextureEntry`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.ImageTextureEntry.html) | Make internal after `registerImageTexture` is no longer public.
[`.OnFrameConsumedListener`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.OnFrameConsumedListener.html) | Remove or make `@VisibleForTesting`, [1 usage](https://github.com/search?q=repo%3Aflutter%2Fengine+%22TextureRegistry.OnFrameConsumedListener%22&type=code). 
[`.OnTrimMemoryListener`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.OnTrimMemoryListener.html) | Make internal, [used in one place internally only](https://github.com/search?q=repo%3Aflutter%2Fengine+%22TextureRegistry.OnTrimMemoryListener%22&type=code).
[`.TextureEntry`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.TextureEntry.html) | Remove once there is only `SurfaceProducer`.
[`.createImageTexture`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.html#createImageTexture()) | Make internal only, [1 usage internally](https://github.com/flutter/engine/blob/fecb03c8edd4195b44afdbb834946170a686af6e/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java#L994).
[`.onTrimMemory`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.html#onTrimMemory(int)) | Make internal only.

---

Assigned @jonahwilliams and @johnmccutchan to review while I'm on vacation 😎