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

Commit 410c9d73 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Remove unneccessary #isHardwareAccelerated"

parents 3ffd7956 85308531
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -96,10 +96,12 @@ static void Camera_getMatrix(JNIEnv* env, jobject obj, jlong matrixHandle) {
}

static void Camera_applyToCanvas(JNIEnv* env, jobject obj, jlong canvasHandle) {
    SkCanvas* canvas = reinterpret_cast<android::Canvas*>(canvasHandle)->asSkCanvas();
    android::Canvas* canvas = reinterpret_cast<android::Canvas*>(canvasHandle);
    jlong viewHandle = env->GetLongField(obj, gNativeInstanceFieldID);
    Sk3DView* v = reinterpret_cast<Sk3DView*>(viewHandle);
    v->applyToCanvas(canvas);
    SkMatrix matrix;
    v->getMatrix(&matrix);
    canvas->concat(matrix);
}

static jfloat Camera_dotWithNormal(JNIEnv* env, jobject obj,
+1 −9
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import android.annotation.UnsupportedAppUsage;
 * {@link Canvas}.
 */
public class Camera {
    private Matrix mMatrix;

    /**
     * Creates a new camera, with empty transformations.
     */
@@ -151,14 +149,8 @@ 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.getNativeCanvasWrapper());
    }
    }

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