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

Commit 7fbbc3c9 authored by Romain Guy's avatar Romain Guy
Browse files

Camera.applyToCanvas() now works with hardware canvases

Change-Id: I7f06b2a74ccc1941d51e12a0417028e094c1b669
parent b15b446f
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);