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

Commit 0b95073a authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Aviod divider surface memory allocated after boot" into rvc-dev am:...

Merge "Aviod divider surface memory allocated after boot" into rvc-dev am: e13e2229 am: 38c1cbce

Change-Id: I0450f575769d5570e02f4085a6d4518efe24d5c2
parents 32dd1fa4 38c1cbce
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ public class WindowlessWindowManager implements IWindowSession {
    private final static String TAG = "WindowlessWindowManager";

    private class State {
        //TODO : b/150190730 we should create it when view show and release it when view invisible.
        SurfaceControl mSurfaceControl;
        WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
        int mDisplayId;
@@ -239,21 +240,19 @@ public class WindowlessWindowManager implements IWindowSession {
        }
        WindowManager.LayoutParams attrs = state.mParams;

        if (viewFlags == View.VISIBLE) {
            final Rect surfaceInsets = attrs.surfaceInsets;
        int width = surfaceInsets != null ?
                attrs.width + surfaceInsets.left + surfaceInsets.right : attrs.width;
        int height = surfaceInsets != null ?
                attrs.height + surfaceInsets.top + surfaceInsets.bottom : attrs.height;
            int width = surfaceInsets != null
                    ? attrs.width + surfaceInsets.left + surfaceInsets.right : attrs.width;
            int height = surfaceInsets != null
                    ? attrs.height + surfaceInsets.top + surfaceInsets.bottom : attrs.height;

        t.setBufferSize(sc, width, height)
            .setOpaque(sc, isOpaque(attrs));
        if (viewFlags == View.VISIBLE) {
            t.show(sc);
            t.setBufferSize(sc, width, height).setOpaque(sc, isOpaque(attrs)).show(sc).apply();
            outSurfaceControl.copyFrom(sc);
        } else {
            t.hide(sc);
            t.hide(sc).apply();
            outSurfaceControl.release();
        }
        t.apply();
        outSurfaceControl.copyFrom(sc);
        outFrame.set(0, 0, attrs.width, attrs.height);

        mergedConfiguration.setConfiguration(mConfiguration, mConfiguration);
+2 −2
Original line number Diff line number Diff line
@@ -189,8 +189,8 @@ public class SystemWindows {
    public SurfaceControl getViewSurface(View rootView) {
        for (int i = 0; i < mPerDisplay.size(); ++i) {
            for (int iWm = 0; iWm < mPerDisplay.valueAt(i).mWwms.size(); ++iWm) {
                SurfaceControl out =
                        mPerDisplay.valueAt(i).mWwms.get(iWm).getSurfaceControlForWindow(rootView);
                SurfaceControl out = mPerDisplay.valueAt(i).mWwms.valueAt(iWm)
                        .getSurfaceControlForWindow(rootView);
                if (out != null) {
                    return out;
                }