From 4d5e630349de51be56a6aaee1ab392b51670694f Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 23 Mar 2020 12:47:06 -0700 Subject: SurfaceControlViewHost: Enable HARDWARE_ACCLERATION by default Normally we rely on the Activity stack to set this for us. Many use cases require acceleration to be usable, we don't want to expose the layout params in the public API so instead we just make HARDWARE_ACCELERATION the default. Bug: 152103238 Test: SurfaceControlViewHostTests Change-Id: I767d351b0e5278642ae61074b47f01d185c026c8 --- core/java/android/view/SurfaceControlViewHost.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java index cd22ad6151b8..fe70ff7a1dbf 100644 --- a/core/java/android/view/SurfaceControlViewHost.java +++ b/core/java/android/view/SurfaceControlViewHost.java @@ -192,6 +192,7 @@ public class SurfaceControlViewHost { final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height, WindowManager.LayoutParams.TYPE_APPLICATION, 0, PixelFormat.TRANSPARENT); + lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; setView(view, lp); } -- cgit v1.2.3-59-g8ed1b