#define _USE_MATH_DEFINES …
#include "third_party/blink/renderer/modules/xr/xr_view.h"
#include <algorithm>
#include <cmath>
#include "third_party/blink/renderer/modules/xr/xr_camera.h"
#include "third_party/blink/renderer/modules/xr/xr_depth_manager.h"
#include "third_party/blink/renderer/modules/xr/xr_frame.h"
#include "third_party/blink/renderer/modules/xr/xr_session.h"
#include "third_party/blink/renderer/modules/xr/xr_utils.h"
#include "ui/gfx/geometry/point3_f.h"
namespace blink {
namespace {
constexpr double kMinViewportScale = …;
const double kDegToRad = …;
}
XRView::XRView(XRFrame* frame,
XRViewData* view_data,
const gfx::Transform& ref_space_from_mojo)
: … { … }
XRViewport* XRView::Viewport(double framebuffer_scale) { … }
XRFrame* XRView::frame() const { … }
XRSession* XRView::session() const { … }
DOMFloat32Array* XRView::projectionMatrix() const { … }
XRCPUDepthInformation* XRView::GetCpuDepthInformation(
ExceptionState& exception_state) const { … }
XRWebGLDepthInformation* XRView::GetWebGLDepthInformation(
ExceptionState& exception_state) const { … }
XRViewData::XRViewData(
wtf_size_t index,
device::mojom::blink::XRViewPtr view,
double depth_near,
double depth_far,
const device::mojom::blink::XRSessionDeviceConfig& device_config,
const HashSet<device::mojom::XRSessionFeature>& enabled_feature_set)
: … { … }
void XRViewData::UpdateView(device::mojom::blink::XRViewPtr view,
double depth_near,
double depth_far) { … }
void XRViewData::UpdateProjectionMatrixFromFoV(float up_rad,
float down_rad,
float left_rad,
float right_rad,
float near_depth,
float far_depth) { … }
void XRViewData::UpdateProjectionMatrixFromAspect(float fovy,
float aspect,
float near_depth,
float far_depth) { … }
gfx::Transform XRViewData::UnprojectPointer(double x,
double y,
double canvas_width,
double canvas_height) { … }
void XRViewData::SetMojoFromView(const gfx::Transform& mojo_from_view) { … }
XRCPUDepthInformation* XRViewData::GetCpuDepthInformation(
const XRFrame* xr_frame,
ExceptionState& exception_state) const { … }
XRWebGLDepthInformation* XRViewData::GetWebGLDepthInformation(
const XRFrame* xr_frame,
ExceptionState& exception_state) const { … }
XRRigidTransform* XRView::refSpaceFromView() const { … }
std::optional<double> XRView::recommendedViewportScale() const { … }
void XRView::requestViewportScale(std::optional<double> scale) { … }
XRCamera* XRView::camera() const { … }
bool XRView::isFirstPersonObserver() const { … }
void XRView::Trace(Visitor* visitor) const { … }
std::optional<double> XRViewData::recommendedViewportScale() const { … }
void XRViewData::requestViewportScale(std::optional<double> scale) { … }
void XRViewData::Trace(Visitor* visitor) const { … }
}