blob: a146eb0e752a696d8859ac2467239ba1efaf7069 [file] [log] [blame]
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/xr/xr_cube_layer.h"
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_xr_cube_layer_init.h"
#include "third_party/blink/renderer/core/geometry/dom_point_read_only.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/xr/xr_graphics_binding.h"
#include "third_party/blink/renderer/modules/xr/xr_session.h"
namespace blink {
XRCubeLayer::XRCubeLayer(const XRCubeLayerInit* init,
XRGraphicsBinding* binding,
XRLayerDrawingContext* drawing_context)
: XRShapedLayer(init, binding, drawing_context),
orientation_(init->orientation()) {
CreateLayerBackend();
}
XRLayerType XRCubeLayer::LayerType() const {
return XRLayerType::kCubeLayer;
}
void XRCubeLayer::setOrientation(DOMPointReadOnly* orientation) {
if (orientation_ != orientation) {
orientation_ = orientation;
SetModified(true);
}
}
void XRCubeLayer::Trace(Visitor* visitor) const {
visitor->Trace(orientation_);
XRShapedLayer::Trace(visitor);
}
} // namespace blink