#include "third_party/blink/renderer/modules/xr/xr_frame_provider.h"
#include <utility>
#include "base/not_fatal_until.h"
#include "build/build_config.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/dom/frame_request_callback_collection.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/navigator.h"
#include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/modules/xr/xr_session.h"
#include "third_party/blink/renderer/modules/xr/xr_system.h"
#include "third_party/blink/renderer/modules/xr/xr_viewport.h"
#include "third_party/blink/renderer/modules/xr/xr_webgl_layer.h"
#include "third_party/blink/renderer/platform/graphics/gpu/xr_frame_transport.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "ui/display/display.h"
#include "ui/gfx/geometry/transform.h"
namespace blink {
namespace {
class XRFrameProviderRequestCallback : public FrameCallback { … };
}
XRFrameProvider::XRFrameProvider(XRSystem* xr)
: … { … }
void XRFrameProvider::AddImmersiveSessionObserver(
ImmersiveSessionObserver* observer) { … }
void XRFrameProvider::OnSessionStarted(
XRSession* session,
device::mojom::blink::XRSessionPtr session_ptr) { … }
void XRFrameProvider::OnFocusChanged() { … }
void XRFrameProvider::OnProviderConnectionError(XRSession* session) { … }
void XRFrameProvider::OnSessionEnded(XRSession* session) { … }
void XRFrameProvider::RestartNonImmersiveFrameLoop() { … }
void XRFrameProvider::RequestFrame(XRSession* session) { … }
void XRFrameProvider::ScheduleImmersiveFrame(
device::mojom::blink::XRFrameDataRequestOptionsPtr options) { … }
void XRFrameProvider::ScheduleNonImmersiveFrame(
device::mojom::blink::XRFrameDataRequestOptionsPtr options) { … }
void XRFrameProvider::OnImmersiveFrameData(
device::mojom::blink::XRFrameDataPtr data) { … }
void XRFrameProvider::OnNonImmersiveVSync(double high_res_now_ms) { … }
void XRFrameProvider::OnNonImmersiveFrameData(
XRSession* session,
device::mojom::blink::XRFrameDataPtr frame_data) { … }
void XRFrameProvider::RequestNonImmersiveFrameData(XRSession* session) { … }
void XRFrameProvider::ProcessScheduledFrame(
device::mojom::blink::XRFrameDataPtr frame_data,
double high_res_now_ms,
ScheduledFrameType frame_type) { … }
void XRFrameProvider::OnPreDispatchInlineFrame(
XRSession* session,
double timestamp,
const std::optional<gpu::MailboxHolder>& output_mailbox_holder,
const std::optional<gpu::MailboxHolder>& camera_image_mailbox_holder) { … }
double XRFrameProvider::UpdateImmersiveFrameTime(
LocalDOMWindow* window,
const device::mojom::blink::XRFrameData& data) { … }
void XRFrameProvider::SubmitWebGLLayer(XRWebGLLayer* layer, bool was_changed) { … }
void XRFrameProvider::UpdateWebGLLayerViewports(XRWebGLLayer* layer) { … }
void XRFrameProvider::Dispose() { … }
void XRFrameProvider::SendFrameData() { … }
void XRFrameProvider::Trace(Visitor* visitor) const { … }
}