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

Commit 302a9df1 authored by Romain Guy's avatar Romain Guy
Browse files

Add an API to set the transform on a TextureView's surface texture.

Bug #5156689

Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
parent 95a78c38
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -22478,12 +22478,14 @@ package android.view {
    method public android.graphics.Bitmap getBitmap(android.graphics.Bitmap);
    method public android.graphics.SurfaceTexture getSurfaceTexture();
    method public android.view.TextureView.SurfaceTextureListener getSurfaceTextureListener();
    method public android.graphics.Matrix getTransform(android.graphics.Matrix);
    method public boolean isAvailable();
    method public android.graphics.Canvas lockCanvas();
    method public android.graphics.Canvas lockCanvas(android.graphics.Rect);
    method protected final void onDraw(android.graphics.Canvas);
    method public void setOpaque(boolean);
    method public void setSurfaceTextureListener(android.view.TextureView.SurfaceTextureListener);
    method public void setTransform(android.graphics.Matrix);
    method public void unlockCanvasAndPost(android.graphics.Canvas);
  }
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ class GLES20Canvas extends HardwareCanvas {
    static native void nResizeLayer(int layerId, int width, int height, int[] layerInfo);
    static native void nUpdateTextureLayer(int layerId, int width, int height, boolean opaque,
            SurfaceTexture surface);
    static native void nSetTextureLayerTransform(int layerId, int matrix);
    static native void nDestroyLayer(int layerId);
    static native void nDestroyLayerDeferred(int layerId);
    static native boolean nCopyLayer(int layerId, int bitmap);
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.view;

import android.graphics.Canvas;
import android.graphics.Matrix;

/**
 * An OpenGL ES 2.0 implementation of {@link HardwareLayer}. This
@@ -87,4 +88,11 @@ class GLES20RenderLayer extends GLES20Layer {
        }
        return getCanvas();
    }

    /**
     * Ignored
     */
    @Override
    void setTransform(Matrix matrix) {
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.view;

import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.SurfaceTexture;

/**
@@ -75,4 +76,9 @@ class GLES20TextureLayer extends GLES20Layer {
        super.update(width, height, isOpaque);
        GLES20Canvas.nUpdateTextureLayer(mLayer, width, height, isOpaque, mSurface);
    }

    @Override
    void setTransform(Matrix matrix) {
        GLES20Canvas.nSetTextureLayerTransform(mLayer, matrix.native_instance);
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.view;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;

/**
 * A hardware layer can be used to render graphics operations into a hardware
@@ -150,4 +151,11 @@ abstract class HardwareLayer {
        mHeight = height;
        mOpaque = isOpaque;
    }

    /**
     * Sets an optional transform on this layer.
     * 
     * @param matrix The transform to apply to the layer.
     */
    abstract void setTransform(Matrix matrix);
}
Loading