Bug 1822393 - Consume GeckoView directly in Android Components for CI builds. r=owlis...
[gecko.git] / gfx / vr / VRDisplayPresentation.h
blob368048743f82b9e0ab365e7151578ae4da530bc6
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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_VR_DISPLAY_PRESENTATION_H
8 #define GFX_VR_DISPLAY_PRESENTATION_H
10 #include "mozilla/RefPtr.h"
11 #include "mozilla/dom/VRDisplayBinding.h"
13 namespace mozilla {
14 namespace dom {
15 class XRWebGLLayer;
17 namespace gfx {
18 class VRDisplayClient;
19 class VRLayerChild;
21 class VRDisplayPresentation final {
22 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRDisplayPresentation)
24 public:
25 VRDisplayPresentation(VRDisplayClient* aDisplayClient,
26 const nsTArray<dom::VRLayer>& aLayers, uint32_t aGroup);
27 void UpdateLayers(const nsTArray<mozilla::dom::VRLayer>& aLayers);
28 void UpdateXRWebGLLayer(dom::XRWebGLLayer* aLayer);
29 void SubmitFrame();
30 void GetDOMLayers(nsTArray<dom::VRLayer>& result);
31 uint32_t GetGroup() const;
33 private:
34 ~VRDisplayPresentation();
35 void CreateLayers();
36 void DestroyLayers();
38 RefPtr<VRDisplayClient> mDisplayClient;
39 nsTArray<dom::VRLayer> mDOMLayers;
40 nsTArray<RefPtr<VRLayerChild>> mLayers;
41 uint32_t mGroup;
44 } // namespace gfx
45 } // namespace mozilla
47 #endif /* GFX_VR_DISPLAY_PRESENTAITON_H */