Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public class FlutterRenderer implements TextureRegistry {
*/
@VisibleForTesting public static boolean debugForceSurfaceProducerGlTextures = false;

/** Whether to disable clearing of the Surface used to render platform views. */
@VisibleForTesting public static boolean debugDisableSurfaceClear = false;

private static final String TAG = "FlutterRenderer";

@NonNull private final FlutterJNI flutterJNI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import androidx.annotation.VisibleForTesting;
import io.flutter.Log;
import io.flutter.embedding.android.AndroidTouchProcessor;
import io.flutter.embedding.engine.renderer.FlutterRenderer;
import io.flutter.util.ViewUtils;

/**
Expand Down Expand Up @@ -63,7 +64,7 @@ public PlatformViewWrapper(
this.renderTarget = renderTarget;

Surface surface = renderTarget.getSurface();
if (surface != null) {
if (surface != null && !FlutterRenderer.debugDisableSurfaceClear) {
final Canvas canvas = surface.lockHardwareCanvas();
try {
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public void onCreate(@Nullable Bundle arguments) {
"--impeller-backend=" + arguments.getString("impeller-backend", "vulkan")
};
}
FlutterRenderer.debugDisableSurfaceClear = true;
if ("true".equals(arguments.getString("force-surface-producer-surface-texture"))) {
// Set a test flag to force the SurfaceProducer to use SurfaceTexture.
FlutterRenderer.debugForceSurfaceProducerGlTextures = true;
Expand Down