Conditionally enable HardwareBuffer backed platform views (flutter/engine#44744)
On Android >= 29 we can use a more efficient platform view render target
This commit is contained in:
@@ -968,11 +968,12 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega
|
||||
|
||||
private static PlatformViewRenderTarget makePlatformViewRenderTarget(
|
||||
TextureRegistry textureRegistry) {
|
||||
// TODO(johnmccutchan): Enable ImageReaderPlatformViewRenderTarget for public use.
|
||||
if (false) {
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
// Prefer ImageReader-based backend on versions >= 29.
|
||||
final TextureRegistry.ImageTextureEntry textureEntry = textureRegistry.createImageTexture();
|
||||
return new ImageReaderPlatformViewRenderTarget(textureEntry);
|
||||
}
|
||||
// Fallback to SurfaceTexture support on old phones.
|
||||
final TextureRegistry.SurfaceTextureEntry textureEntry = textureRegistry.createSurfaceTexture();
|
||||
return new SurfaceTexturePlatformViewRenderTarget(textureEntry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user