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

Commit 51f7c6b3 authored by Romain Guy's avatar Romain Guy
Browse files

Flip TextureView's layer after calling setSurfaceTexture()

Bug #6531172

Changing the surface texture would not update the layer properties
nor its transform matrix.

Change-Id: I54e155a410d7e72f1a8edf3a4ab0034bf764ae28
parent e2d7f182
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -374,6 +374,14 @@ public class TextureView extends View {
            // tell mLayer about it and set the SurfaceTexture to use the
            // tell mLayer about it and set the SurfaceTexture to use the
            // current view size.
            // current view size.
            mUpdateSurface = false;
            mUpdateSurface = false;

            // Since we are updating the layer, force an update to ensure its
            // parameters are correct (width, height, transform, etc.)
            synchronized (mLock) {
                mUpdateLayer = true;
            }
            mMatrixChanged = true;

            mAttachInfo.mHardwareRenderer.setSurfaceTexture(mLayer, mSurface);
            mAttachInfo.mHardwareRenderer.setSurfaceTexture(mLayer, mSurface);
            nSetDefaultBufferSize(mSurface, getWidth(), getHeight());
            nSetDefaultBufferSize(mSurface, getWidth(), getHeight());
        }
        }
@@ -471,7 +479,7 @@ public class TextureView extends View {
    }
    }


    private void applyTransformMatrix() {
    private void applyTransformMatrix() {
        if (mMatrixChanged) {
        if (mMatrixChanged && mLayer != null) {
            mLayer.setTransform(mMatrix);
            mLayer.setTransform(mMatrix);
            mMatrixChanged = false;
            mMatrixChanged = false;
        }
        }