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

Commit a5f301c7 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Legacy: Only set user surface dimensions on output surfaces" into lmp-mr1-dev

parents c7ccc393 b0acf7fc
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -598,15 +598,10 @@ static jint LegacyCameraDevice_nativeSetSurfaceDimens(JNIEnv* env, jobject thiz,
        ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
        return BAD_VALUE;
    }
    status_t err = native_window_set_buffers_dimensions(anw.get(), width, height);
    if (err != NO_ERROR) {
        ALOGE("%s: Error while setting surface dimens %s (%d).", __FUNCTION__, strerror(-err), err);
        return err;
    }

    // WAR - Set user dimensions also to avoid incorrect scaling after TextureView orientation
    // change.
    err = native_window_set_buffers_user_dimensions(anw.get(), width, height);
    // Set user dimensions only
    // The producer dimensions are owned by GL
    status_t err = native_window_set_buffers_user_dimensions(anw.get(), width, height);
    if (err != NO_ERROR) {
        ALOGE("%s: Error while setting surface user dimens %s (%d).", __FUNCTION__, strerror(-err),
                err);
@@ -750,4 +745,3 @@ int register_android_hardware_camera2_legacy_LegacyCameraDevice(JNIEnv* env)
            gCameraDeviceMethods,
            NELEM(gCameraDeviceMethods));
}