Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / vr / XRFrame.h
blob26bd601f3a7ea524b8d91632b8ef69035cc95f0c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_XRFrame_h_
8 #define mozilla_dom_XRFrame_h_
10 #include "mozilla/DOMEventTargetHelper.h"
11 #include "mozilla/dom/WebXRBinding.h"
13 #include "gfxVR.h"
15 namespace mozilla::dom {
17 class XRFrameOfReference;
18 class XRInputPose;
19 class XRInputSource;
20 class XRPose;
21 class XRReferenceSpace;
22 class XRSession;
23 class XRSpace;
24 class XRViewerPose;
26 class XRFrame final : public nsWrapperCache {
27 public:
28 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRFrame)
29 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRFrame)
31 explicit XRFrame(nsISupports* aParent, XRSession* aXRSession);
33 void StartAnimationFrame();
34 void EndAnimationFrame();
35 void StartInputSourceEvent();
36 void EndInputSourceEvent();
38 // WebIDL Boilerplate
39 nsISupports* GetParentObject() const { return mParent; }
40 JSObject* WrapObject(JSContext* aCx,
41 JS::Handle<JSObject*> aGivenProto) override;
43 // WebIDL Members
44 XRSession* Session();
45 already_AddRefed<XRViewerPose> GetViewerPose(
46 const XRReferenceSpace& aReferenceSpace, ErrorResult& aRv);
47 already_AddRefed<XRPose> GetPose(const XRSpace& aSpace,
48 const XRSpace& aBaseSpace, ErrorResult& aRv);
49 gfx::Matrix4x4 ConstructInlineProjection(float aFov, float aAspect,
50 float aNear, float aFar);
52 protected:
53 virtual ~XRFrame() = default;
55 nsCOMPtr<nsISupports> mParent;
56 RefPtr<XRSession> mSession;
57 bool mActive;
58 bool mAnimationFrame;
61 } // namespace mozilla::dom
63 #endif // mozilla_dom_XRFrame_h_