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

Commit e9b8ca1b authored by Rob Carr's avatar Rob Carr Committed by Automerger Merge Worker
Browse files

Merge "ViewRootImpl: Use mWindowAttributes directly for BBQ" into sc-dev am:...

Merge "ViewRootImpl: Use mWindowAttributes directly for BBQ" into sc-dev am: b10b4141 am: 35e24bc0

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

Change-Id: I7870db35ef79c5ca5fb20a2021c3290a38f08ceb
parents 2e73a945 35e24bc0
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1970,22 +1970,23 @@ public final class ViewRootImpl implements ViewParent,
       return mBoundsLayer;
    }

    Surface getOrCreateBLASTSurface(int width, int height,
            @Nullable WindowManager.LayoutParams params) {
    Surface getOrCreateBLASTSurface() {
        if (!mSurfaceControl.isValid()) {
            return null;
        }

        int format = params == null ? PixelFormat.TRANSLUCENT : params.format;
        Surface ret = null;
        if (mBlastBufferQueue == null) {
            mBlastBufferQueue = new BLASTBufferQueue(mTag, mSurfaceControl, width, height,
                    format);
            mBlastBufferQueue = new BLASTBufferQueue(mTag, mSurfaceControl,
                mSurfaceSize.x, mSurfaceSize.y,
                mWindowAttributes.format);
            // We only return the Surface the first time, as otherwise
            // it hasn't changed and there is no need to update.
            ret = mBlastBufferQueue.createSurface();
        } else {
            mBlastBufferQueue.update(mSurfaceControl, width, height, format);
            mBlastBufferQueue.update(mSurfaceControl,
                mSurfaceSize.x, mSurfaceSize.y,
                mWindowAttributes.format);
        }

        return ret;
@@ -7799,8 +7800,7 @@ public final class ViewRootImpl implements ViewParent,
            if (!useBLAST()) {
                mSurface.copyFrom(mSurfaceControl);
            } else {
                final Surface blastSurface = getOrCreateBLASTSurface(mSurfaceSize.x, mSurfaceSize.y,
                        params);
                final Surface blastSurface = getOrCreateBLASTSurface();
                // If blastSurface == null that means it hasn't changed since the last time we
                // called. In this situation, avoid calling transferFrom as we would then
                // inc the generation ID and cause EGL resources to be recreated.