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

Commit bb41daad authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Minor fixes to SurfaceTexture transform matrix."

parents 6d978428 c01391fb
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -261,6 +261,7 @@ public class TextureView extends View {
    @Override
    @Override
    public final void draw(Canvas canvas) {
    public final void draw(Canvas canvas) {
        applyUpdate();
        applyUpdate();
        applyTransformMatrix();
    }
    }


    /**
    /**
@@ -315,11 +316,7 @@ public class TextureView extends View {
        }
        }


        applyUpdate();
        applyUpdate();

        applyTransformMatrix();
        if (mMatrixChanged) {
            mLayer.setTransform(mMatrix);
            mMatrixChanged = false;
        }


        return mLayer;
        return mLayer;
    }
    }
@@ -386,7 +383,7 @@ public class TextureView extends View {
    public void setTransform(Matrix transform) {
    public void setTransform(Matrix transform) {
        mMatrix.set(transform);
        mMatrix.set(transform);
        mMatrixChanged = true;
        mMatrixChanged = true;
        invalidate();
        invalidateParentIfNeeded();
    }
    }


    /**
    /**
@@ -410,6 +407,13 @@ public class TextureView extends View {
        return transform;
        return transform;
    }
    }


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

    /**
    /**
     * <p>Returns a {@link android.graphics.Bitmap} representation of the content
     * <p>Returns a {@link android.graphics.Bitmap} representation of the content
     * of the associated surface texture. If the surface texture is not available,
     * of the associated surface texture. If the surface texture is not available,