blob: 316b803918d9a110d19aff66be99884af0b846ea [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/android/vr/gvr_util.h"
#include "ui/gfx/transform.h"
namespace vr {
void TransformToGvrMat(const gfx::Transform& in, gvr::Mat4f* out) {
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
out->m[i][j] = in.matrix().get(i, j);
}
}
}
void GvrMatToTransform(const gvr::Mat4f& in, gfx::Transform* out) {
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
out->matrix().set(i, j, in.m[i][j]);
}
}
}
} // namespace vr