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

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

Merge "Camera.applyToCanvas() now works with hardware canvases" into klp-dev

parents e932e30e 7fbbc3c9
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ package android.graphics;
 * {@link Canvas}.
 */
public class Camera {
    private Matrix mMatrix;

    /**
     * Creates a new camera, with empty transformations.
     */
@@ -147,8 +149,14 @@ public class Camera {
     * @param canvas The Canvas to set the transform matrix onto
     */
    public void applyToCanvas(Canvas canvas) {
        if (canvas.isHardwareAccelerated()) {
            if (mMatrix == null) mMatrix = new Matrix();
            getMatrix(mMatrix);
            canvas.concat(mMatrix);
        } else {
            nativeApplyToCanvas(canvas.mNativeCanvas);
        }
    }

    public native float dotWithNormal(float dx, float dy, float dz);