From b439d25e48d88b4b9bcafb939fee6ded70101d28 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Wed, 28 Feb 2024 15:23:44 -0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Test=20the=20`SurfaceTextureSurfacePr?= =?UTF-8?q?oducer`-branch=20in=20the=20Android=20`scena=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ea6adb071ad3fbc6beb0ff4f794cfdac12359d36. --- .../linux_android_emulator_opengles.json | 26 -------- ci/builders/linux_android_emulator_skia.json | 25 -------- .../engine/renderer/FlutterRenderer.java | 46 ++++++-------- .../SurfaceTextureSurfaceProducer.java | 14 ++--- .../android/io/flutter/view/FlutterView.java | 1 - .../SurfaceTextureSurfaceProducerTest.java | 6 +- .../platform/PlatformViewsControllerTest.java | 2 - testing/scenario_app/android/README.md | 63 ++++++------------- .../java/dev/flutter/TestRunner.java | 6 -- .../ExternalTextureFlutterActivity.java | 18 +++--- testing/scenario_app/bin/README.md | 9 ++- .../scenario_app/bin/run_android_tests.dart | 5 -- testing/scenario_app/bin/utils/options.dart | 36 ----------- 13 files changed, 62 insertions(+), 195 deletions(-) diff --git a/ci/builders/linux_android_emulator_opengles.json b/ci/builders/linux_android_emulator_opengles.json index ddd3f784520a1..7eaeaebbdd541 100644 --- a/ci/builders/linux_android_emulator_opengles.json +++ b/ci/builders/linux_android_emulator_opengles.json @@ -57,32 +57,6 @@ "--enable-impeller", "--impeller-backend=opengles" ] - }, - { - "language": "dart", - "name": "Android Scenario App Integration Tests (Impeller/OpenGLES, SurfaceTexture)", - "test_timeout_secs": 900, - "max_attempts": 2, - "test_dependencies": [ - { - "dependency": "android_virtual_device", - "version": "android_34_google_apis_x64.textpb" - }, - { - "dependency": "avd_cipd_version", - "version": "build_id:8759428741582061553" - } - ], - "contexts": [ - "android_virtual_device" - ], - "script": "flutter/testing/scenario_app/bin/run_android_tests.dart", - "parameters": [ - "--out-dir=../out/android_emulator_opengles_debug_x64", - "--enable-impeller", - "--impeller-backend=opengles", - "--force-surface-producer-surface-texture" - ] } ] } diff --git a/ci/builders/linux_android_emulator_skia.json b/ci/builders/linux_android_emulator_skia.json index 32fcbc96ac174..35294517e2983 100644 --- a/ci/builders/linux_android_emulator_skia.json +++ b/ci/builders/linux_android_emulator_skia.json @@ -57,31 +57,6 @@ "--out-dir=../out/android_emulator_skia_debug_x64", "--no-enable-impeller" ] - }, - { - "language": "dart", - "name": "Android Scenario App Integration Tests (Skia, SurfaceTexture)", - "test_timeout_secs": 900, - "max_attempts": 2, - "test_dependencies": [ - { - "dependency": "android_virtual_device", - "version": "android_34_google_apis_x64.textpb" - }, - { - "dependency": "avd_cipd_version", - "version": "build_id:8759428741582061553" - } - ], - "contexts": [ - "android_virtual_device" - ], - "script": "flutter/testing/scenario_app/bin/run_android_tests.dart", - "parameters": [ - "--out-dir=../out/android_emulator_skia_debug_x64", - "--no-enable-impeller", - "--force-surface-producer-surface-texture" - ] } ] } diff --git a/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java b/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java index 616443597dd0f..8052f59b6d1c6 100644 --- a/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java +++ b/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java @@ -57,7 +57,7 @@ public class FlutterRenderer implements TextureRegistry { * the OpenGLES/{@link SurfaceTextureSurfaceProducer} code branch. This flag has undefined * behavior if set to true while running in a Vulkan (Impeller) context. */ - @VisibleForTesting public static boolean debugForceSurfaceProducerGlTextures = false; + @VisibleForTesting static boolean debugForceSurfaceProducerGlTextures = false; private static final String TAG = "FlutterRenderer"; @@ -184,24 +184,19 @@ public SurfaceProducer createSurfaceProducer() { // Coincidentally, if ImageTexture is available, we are also on an Android // version that is // running Vulkan, so we don't have to worry about it not being supported. + final long id = nextTextureId.getAndIncrement(); final SurfaceProducer entry; if (!debugForceSurfaceProducerGlTextures && Build.VERSION.SDK_INT >= 29) { - final long id = nextTextureId.getAndIncrement(); final ImageReaderSurfaceProducer producer = new ImageReaderSurfaceProducer(id); registerImageTexture(id, producer); addOnTrimMemoryListener(producer); Log.v(TAG, "New ImageReaderSurfaceProducer ID: " + id); entry = producer; } else { - // TODO(matanlurey): Actually have the class named "*Producer" to well, produce - // something. This is a code smell, but does guarantee the paths for both - // createSurfaceTexture and createSurfaceProducer doesn't diverge. As we get more - // confident in this API and any possible bugs (and have tests to check we don't - // regress), reconsider this pattern. - final SurfaceTextureEntry texture = createSurfaceTexture(); final SurfaceTextureSurfaceProducer producer = - new SurfaceTextureSurfaceProducer(texture.id(), handler, flutterJNI, texture); - Log.v(TAG, "New SurfaceTextureSurfaceProducer ID: " + texture.id()); + new SurfaceTextureSurfaceProducer(id, handler, flutterJNI); + registerSurfaceTexture(id, producer.getSurfaceTexture()); + Log.v(TAG, "New SurfaceTextureSurfaceProducer ID: " + id); entry = producer; } return entry; @@ -635,9 +630,8 @@ PerImage dequeueImage() { + " closing image=" + lastDequeuedImage.image.hashCode()); } - // We must keep the last image dequeued open until we are done presenting - // it. We have just dequeued a new image (r). Close the previously dequeued - // image. + // We must keep the last image dequeued open until we are done presenting it. + // We have just dequeued a new image (r). Close the previously dequeued image. lastDequeuedImage.image.close(); lastDequeuedImage = null; } @@ -823,11 +817,11 @@ private ImageReader createImageReader33() { // Allow for double buffering. builder.setMaxImages(MAX_IMAGES); // Use PRIVATE image format so that we can support video decoding. - // TODO(johnmccutchan): Should we always use PRIVATE here? It may impact our ability to - // read back texture data. If we don't always want to use it, how do we decide when to - // use it or not? Perhaps PlatformViews can indicate if they may contain DRM'd content. - // I need to investigate how PRIVATE impacts our ability to take screenshots or capture - // the output of Flutter application. + // TODO(johnmccutchan): Should we always use PRIVATE here? It may impact our ability to read + // back texture data. If we don't always want to use it, how do we decide when to use it or + // not? Perhaps PlatformViews can indicate if they may contain DRM'd content. I need to + // investigate how PRIVATE impacts our ability to take screenshots or capture the output of + // Flutter application. builder.setImageFormat(ImageFormat.PRIVATE); // Hint that consumed images will only be read by GPU. builder.setUsage(HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE); @@ -1014,10 +1008,10 @@ protected void finalize() throws Throwable { */ public void startRenderingToSurface(@NonNull Surface surface, boolean onlySwap) { if (!onlySwap) { - // Stop rendering to the surface releases the associated native resources, which causes - // a glitch when toggling between rendering to an image view (hybrid composition) and - // rendering directly to a Surface or Texture view. For more, - // https://github.com/flutter/flutter/issues/95343 + // Stop rendering to the surface releases the associated native resources, which causes a + // glitch when toggling between rendering to an image view (hybrid composition) and rendering + // directly to a Surface or Texture view. + // For more, https://github.com/flutter/flutter/issues/95343 stopRenderingToSurface(); } @@ -1068,10 +1062,10 @@ public void stopRenderingToSurface() { if (surface != null) { flutterJNI.onSurfaceDestroyed(); - // TODO(mattcarroll): the source of truth for this call should be FlutterJNI, which is - // where the call to onFlutterUiDisplayed() comes from. However, no such native callback - // exists yet, so until the engine and FlutterJNI are configured to call us back when - // rendering stops, we will manually monitor that change here. + // TODO(mattcarroll): the source of truth for this call should be FlutterJNI, which is where + // the call to onFlutterUiDisplayed() comes from. However, no such native callback exists yet, + // so until the engine and FlutterJNI are configured to call us back when rendering stops, we + // will manually monitor that change here. if (isDisplayingFlutterUi) { flutterUiDisplayListener.onFlutterUiNoLongerDisplayed(); } diff --git a/shell/platform/android/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducer.java b/shell/platform/android/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducer.java index 0592a0bab1299..8153fc55826d9 100644 --- a/shell/platform/android/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducer.java +++ b/shell/platform/android/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducer.java @@ -16,19 +16,15 @@ final class SurfaceTextureSurfaceProducer private int requestedBufferHeight; private boolean released; @Nullable private Surface surface; - @NonNull private final TextureRegistry.SurfaceTextureEntry texture; + @NonNull private final SurfaceTexture texture; @NonNull private final Handler handler; @NonNull private final FlutterJNI flutterJNI; - SurfaceTextureSurfaceProducer( - long id, - @NonNull Handler handler, - @NonNull FlutterJNI flutterJNI, - @NonNull TextureRegistry.SurfaceTextureEntry texture) { + SurfaceTextureSurfaceProducer(long id, @NonNull Handler handler, @NonNull FlutterJNI flutterJNI) { this.id = id; this.handler = handler; this.flutterJNI = flutterJNI; - this.texture = texture; + this.texture = new SurfaceTexture(0); } @Override @@ -58,7 +54,7 @@ public void release() { @Override @NonNull public SurfaceTexture getSurfaceTexture() { - return texture.surfaceTexture(); + return texture; } @Override @@ -81,7 +77,7 @@ public int getHeight() { @Override public Surface getSurface() { if (surface == null) { - surface = new Surface(texture.surfaceTexture()); + surface = new Surface(texture); } return surface; } diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index d61d54c78ebbb..cbf111cbaef34 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -968,7 +968,6 @@ public SurfaceTextureWrapper textureWrapper() { return textureWrapper; } - @NonNull @Override public SurfaceTexture surfaceTexture() { return textureWrapper.surfaceTexture(); diff --git a/shell/platform/android/test/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducerTest.java b/shell/platform/android/test/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducerTest.java index fb97be732e42b..81aae38880613 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducerTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/renderer/SurfaceTextureSurfaceProducerTest.java @@ -6,7 +6,6 @@ import android.annotation.TargetApi; import android.graphics.Canvas; -import android.graphics.SurfaceTexture; import android.os.Handler; import android.os.Looper; import android.view.Surface; @@ -23,13 +22,10 @@ public final class SurfaceTextureSurfaceProducerTest { @Test public void createsSurfaceTextureOfGivenSizeAndResizesWhenRequested() { - final FlutterRenderer flutterRenderer = new FlutterRenderer(fakeJNI); - // Create a surface and set the initial size. final Handler handler = new Handler(Looper.getMainLooper()); final SurfaceTextureSurfaceProducer producer = - new SurfaceTextureSurfaceProducer( - 0, handler, fakeJNI, flutterRenderer.registerSurfaceTexture(new SurfaceTexture(0))); + new SurfaceTextureSurfaceProducer(0, handler, fakeJNI); final Surface surface = producer.getSurface(); AtomicInteger frames = new AtomicInteger(); producer diff --git a/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java b/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java index 0b69e6a801880..c5871db27bf1c 100644 --- a/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java +++ b/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java @@ -26,7 +26,6 @@ import android.view.ViewParent; import android.widget.FrameLayout; import android.widget.FrameLayout.LayoutParams; -import androidx.annotation.NonNull; import androidx.test.core.app.ApplicationProvider; import androidx.test.ext.junit.runners.AndroidJUnit4; import io.flutter.embedding.android.FlutterImageView; @@ -1556,7 +1555,6 @@ public SurfaceTextureEntry createSurfaceTexture() { @Override public SurfaceTextureEntry registerSurfaceTexture(SurfaceTexture surfaceTexture) { return new SurfaceTextureEntry() { - @NonNull @Override public SurfaceTexture surfaceTexture() { return mock(SurfaceTexture.class); diff --git a/testing/scenario_app/android/README.md b/testing/scenario_app/android/README.md index a023eb3461991..4dd6d2fb04218 100644 --- a/testing/scenario_app/android/README.md +++ b/testing/scenario_app/android/README.md @@ -17,13 +17,6 @@ Or for a specific, build, such as `android_debug_unopt_arm64`: dart ./testing/scenario_app/bin/run_android_tests.dart --out-dir=../out/android_debug_unopt_arm64 ``` -See also: - -- [File an issue][file_issue] with the `e: scenario-app, platform-android` - labels. - -[file_issue]: https://github.com/flutter/flutter/issues/new?labels=e:%20scenario-app,engine,platform-android,fyi-android,team-engine - ## Debugging Debugging the tests on CI is not straightforward but is being improved: @@ -45,51 +38,31 @@ or locally in `out/.../scenario_app/logs`. You can then view the logs and screenshots on LUCI. [For example](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20Engine%20Drone/2003164/overview): -![Screenshot of the Logs on LUCI](https://github.com/flutter/engine/assets/168174/79dc864c-c18b-4df9-a733-fd55301cc69c) - -For a full list of flags, see [the runner](../bin/README.md). +![Screenshot of the Logs on LUCI](https://github.com/flutter/engine/assets/168174/79dc864c-c18b-4df9-a733-fd55301cc69c). ## CI Configuration -See [`ci/builders`](../../../ci/builders) and grep for `run_android_tests.dart`. - -### Skia - -> [!NOTE] -> As of 2024-02-28, Flutter on Android defaults to the Skia graphics backend. - -There are two code branches we test using `scenario_app`: - -- Older Android devices, that use `SurfaceTexture`. - - CI Configuration (TODO: Link) - - CI History (TODO: Link) - - Skia Gold (TODO: Link) -- Newer Android devices, (API 34) that use `ImageReader`. - - CI Configuration (TODO: Link) - - CI History (TODO: Link) - - Skia Gold (TODO: Link) - -### Impeller with OpenGLES - -There are two code branches we test using `scenario_app`: +See [`ci/builders/linux_android_emulator.json`](../../../ci/builders/linux_android_emulator.json) +, and grep for `run_android_tests.dart`. -- Older Android devices, that use `SurfaceTexture`. - - CI Configuration (TODO: Link) - - CI History (TODO: Link) - - Skia Gold (TODO: Link) -- Newer Android devices, (API 34) that use `ImageReader`. - - CI Configuration (TODO: Link) - - CI History (TODO: Link) - - Skia Gold (TODO: Link) +The following matrix of configurations is tested on the CI: -### Impeller with Vulkan + -There is only a single code branch we test using `scenario_app`: +| API Version | Graphics Backend | Skia Gold | Rationale | +| ----------- | ------------------- | ---------------------------------------------------------------- | ------------------------------------------------ | +| 34 | Skia | [Android 34 + Skia][skia-gold-skia-34] | Newer Android devices on Skia. | +| 34 | Impeller (OpenGLES) | [Android 34 + Impeller OpenGLES][skia-gold-impeller-opengles-34] | Newer Android devices on Impeller with OpenGLES. | +| 34 | Impeller (Vulkan) | [Android 34 + Impeller Vulkan][skia-gold-impeller-vulkan-34] | Newer Android devices on Impeller. | -- Newer Android devices, (API 34) - - CI Configuration (TODO: Link) - - CI History (TODO: Link) - - Skia Gold (TODO: Link) +[skia-gold-skia-34]: https://flutter-engine-gold.skia.org/search?left_filter=AndroidAPILevel%3D34%26GraphicsBackend%3Dskia&negative=true&positive=true&right_filter=AndroidAPILevel%3D34%26GraphicsBackend%3Dskia +[skia-gold-impeller-opengles-34]: https://flutter-engine-gold.skia.org/search?left_filter=AndroidAPILevel%3D34%26GraphicsBackend%3Dimpeller-opengles&negative=true&positive=true&right_filter=AndroidAPILevel%3D34%26GraphicsBackend%3Dimpeller-opengles +[skia-gold-impeller-vulkan-34]: https://flutter-engine-gold.skia.org/search?left_filter=AndroidAPILevel%3D34%26GraphicsBackend%3Dimpeller-vulkan&negative=true&positive=true&right_filter=AndroidAPILevel%3D34%26GraphicsBackend%3Dimpeller-vulkan ## Updating Gradle dependencies diff --git a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/TestRunner.java b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/TestRunner.java index 6c2989c1517b4..89494f200cc1d 100644 --- a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/TestRunner.java +++ b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/TestRunner.java @@ -9,13 +9,11 @@ import androidx.test.runner.AndroidJUnitRunner; import dev.flutter.scenariosui.ScreenshotUtil; import io.flutter.FlutterInjector; -import io.flutter.embedding.engine.renderer.FlutterRenderer; public class TestRunner extends AndroidJUnitRunner { @Override public void onCreate(@Nullable Bundle arguments) { String[] engineArguments = null; - assert arguments != null; if ("true".equals(arguments.getString("enable-impeller"))) { // Set up the global settings object so that Impeller is enabled for all tests. engineArguments = @@ -24,10 +22,6 @@ public void onCreate(@Nullable Bundle arguments) { "--impeller-backend=" + arguments.getString("impeller-backend", "vulkan") }; } - if ("true".equals(arguments.getString("force-surface-producer-surface-texture"))) { - // Set a test flag to force the SurfaceProducer to use SurfaceTexture. - FlutterRenderer.debugForceSurfaceProducerGlTextures = true; - } // For consistency, just always initilaize FlutterJNI etc. FlutterInjector.instance().flutterLoader().startInitialization(getTargetContext()); FlutterInjector.instance() diff --git a/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java b/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java index 8479673a6ca60..f06f75fcd801b 100644 --- a/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java +++ b/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java @@ -11,6 +11,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Shader.TileMode; +import android.graphics.SurfaceTexture; import android.hardware.HardwareBuffer; import android.media.Image; import android.media.ImageReader; @@ -35,7 +36,7 @@ import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.core.util.Supplier; -import io.flutter.view.TextureRegistry; +import io.flutter.view.TextureRegistry.SurfaceTextureEntry; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Map; @@ -53,7 +54,7 @@ public class ExternalTextureFlutterActivity extends TestActivity { private final CountDownLatch firstFrameLatch = new CountDownLatch(2); private long textureId = 0; - private TextureRegistry.SurfaceProducer surfaceProducer; + private SurfaceTextureEntry surfaceTextureEntry; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -142,18 +143,19 @@ private MediaExtractor createMediaExtractor() { public void onPause() { surfaceViewRenderer.destroy(); flutterRenderer.destroy(); - surfaceProducer.release(); + surfaceTextureEntry.release(); super.onPause(); } @Override public void onFlutterUiDisplayed() { - surfaceProducer = - Objects.requireNonNull(getFlutterEngine()).getRenderer().createSurfaceProducer(); - surfaceProducer.setSize(SURFACE_WIDTH, SURFACE_HEIGHT); - flutterRenderer.attach(surfaceProducer.getSurface(), firstFrameLatch); + surfaceTextureEntry = + Objects.requireNonNull(getFlutterEngine()).getRenderer().createSurfaceTexture(); + SurfaceTexture surfaceTexture = surfaceTextureEntry.surfaceTexture(); + surfaceTexture.setDefaultBufferSize(SURFACE_WIDTH, SURFACE_HEIGHT); + flutterRenderer.attach(new Surface(surfaceTexture), firstFrameLatch); flutterRenderer.repaint(); - textureId = surfaceProducer.id(); + textureId = surfaceTextureEntry.id(); super.onFlutterUiDisplayed(); } diff --git a/testing/scenario_app/bin/README.md b/testing/scenario_app/bin/README.md index 40863acbb5a0b..6125827a8b75d 100644 --- a/testing/scenario_app/bin/README.md +++ b/testing/scenario_app/bin/README.md @@ -1,10 +1,17 @@ -# Scenario App Android Test Runner +# `android_integration_tests` runner This directory contains code specific to running Android integration tests. The tests are uploaded and run on the device using `adb`, and screenshots are captured and compared using Skia Gold (if available, for example on CI). +See also: + +- [File an issue][file_issue] with the `e: scenario-app, platform-android` + labels. + +[file_issue]: https://github.com/flutter/flutter/issues/new?labels=e:%20scenario-app,engine,platform-android,fyi-android,team-engine + ## Usage ```sh diff --git a/testing/scenario_app/bin/run_android_tests.dart b/testing/scenario_app/bin/run_android_tests.dart index b85ad6436d79a..37db27a5b51b1 100644 --- a/testing/scenario_app/bin/run_android_tests.dart +++ b/testing/scenario_app/bin/run_android_tests.dart @@ -78,7 +78,6 @@ void main(List args) async { logsDir: Directory(options.logsDir), contentsGolden: options.outputContentsGolden, ndkStack: options.ndkStack, - forceSurfaceProducerSurfaceTexture: options.forceSurfaceProducerSurfaceTexture, ); onSigint.cancel(); exit(0); @@ -121,7 +120,6 @@ Future _run({ required Directory logsDir, required String? contentsGolden, required String ndkStack, - required bool forceSurfaceProducerSurfaceTexture, }) async { const ProcessManager pm = LocalProcessManager(); final String scenarioAppPath = join(outDir.path, 'scenario_app'); @@ -292,7 +290,6 @@ Future _run({ final Map dimensions = { 'AndroidAPILevel': connectedDeviceAPILevel, 'GraphicsBackend': enableImpeller ? 'impeller-${impellerBackend!.name}' : 'skia', - 'ForceSurfaceProducerSurfaceTexture': '$forceSurfaceProducerSurfaceTexture' }; log('using dimensions: ${json.encode(dimensions)}'); skiaGoldClient = SkiaGoldClient( @@ -348,8 +345,6 @@ Future _run({ '-e enable-impeller true', if (impellerBackend != null) '-e impeller-backend ${impellerBackend.name}', - if (forceSurfaceProducerSurfaceTexture) - '-e force-surface-producer-surface-texture true', 'dev.flutter.scenarios.test/dev.flutter.TestRunner', ]); if (exitCode != 0) { diff --git a/testing/scenario_app/bin/utils/options.dart b/testing/scenario_app/bin/utils/options.dart index 43cb0e6bed5d3..057256afe1cac 100644 --- a/testing/scenario_app/bin/utils/options.dart +++ b/testing/scenario_app/bin/utils/options.dart @@ -46,17 +46,6 @@ extension type const Options._(ArgResults _args) { ); } - // Cannot use forceSurfaceProducerSurfaceTexture with Impeller+Vulkan. - if (options.forceSurfaceProducerSurfaceTexture && - options.enableImpeller && - options.impellerBackend != 'opengles') { - throw const FormatException( - 'Cannot use --force-surface-producer-surface-texture with ' - '--enable-impeller unless --impeller-backend="opengles" is used. See ' - 'https://github.com/flutter/flutter/issues/143539 for details.', - ); - } - return options; } @@ -145,20 +134,6 @@ extension type const Options._(ArgResults _args) { 'default backend will be used. To explicitly run with the Skia ' 'backend, set this to false (--no-enable-impeller).', ) - ..addFlag( - 'force-surface-producer-surface-texture', - help: - 'Whether to force the use of SurfaceTexture as the SurfaceProducer ' - 'rendering strategy. This is used to emulate the behavior of older ' - 'devices that do not support ImageReader, or to explicitly test ' - 'SurfaceTexture path for rendering plugins still using the older ' - 'createSurfaceTexture() API.' - '\n' - 'Cannot be used with --enable-impeller unless --impeller-backend=' - '"opengles" is used. See ' - 'https://github.com/flutter/flutter/issues/143539 for details.', - negatable: false - ) ..addOption( 'impeller-backend', help: 'The graphics backend to use when --enable-impeller is true. ' @@ -303,15 +278,4 @@ extension type const Options._(ArgResults _args) { /// Path to a file that contains the expected filenames of golden files. String? get outputContentsGolden => _args['output-contents-golden'] as String; - - /// Whether to force the use of `SurfaceTexture` for `SurfaceProducer`. - /// - /// Always returns `false` if `--enable-impeller` is `true` and - /// `--impeller-backend` is not `opengles`. - bool get forceSurfaceProducerSurfaceTexture { - if (enableImpeller && impellerBackend != 'opengles') { - return false; - } - return _args['force-surface-producer-surface-texture'] as bool; - } }