Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb9678f7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "SurfaceControlViewHost: Always set FLAG_HARDWARE_ACCELERATED for...

Merge "SurfaceControlViewHost: Always set FLAG_HARDWARE_ACCELERATED for embedded views" into sc-dev am: 4a94d396

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13609278

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I094896efee85bf8faf4c4f7230dacc71aa0e1095
parents 6b1fc665 4a94d396
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -217,16 +217,6 @@ public class SurfaceControlViewHost {
        }
    }

    /**
     * @hide
     */
    @TestApi
    public void setView(@NonNull View view, @NonNull WindowManager.LayoutParams attrs) {
        Objects.requireNonNull(view);
        view.setLayoutParams(attrs);
        mViewRoot.setView(view, attrs, null);
    }

    /**
     * Set the root view of the SurfaceControlViewHost. This view will render in to
     * the SurfaceControl, and receive input based on the SurfaceControls positioning on
@@ -240,10 +230,20 @@ 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);
    }

    /**
     * @hide
     */
    @TestApi
    public void setView(@NonNull View view, @NonNull WindowManager.LayoutParams attrs) {
        Objects.requireNonNull(view);
        attrs.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
        view.setLayoutParams(attrs);
        mViewRoot.setView(view, attrs, null);
    }

    /**
     * @return The view passed to setView, or null if none has been passed.
     */