Line data Source code
1 : /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : * This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef GFX_VR_DISPLAY_PRESENTATION_H
7 : #define GFX_VR_DISPLAY_PRESENTATION_H
8 :
9 : #include "mozilla/RefPtr.h"
10 : #include "mozilla/dom/VRDisplayBinding.h"
11 :
12 : namespace mozilla {
13 : namespace gfx {
14 : class VRDisplayClient;
15 : class VRLayerChild;
16 :
17 : class VRDisplayPresentation final
18 : {
19 0 : NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRDisplayPresentation)
20 :
21 : public:
22 : VRDisplayPresentation(VRDisplayClient *aDisplayClient,
23 : const nsTArray<dom::VRLayer>& aLayers,
24 : uint32_t aGroup);
25 : void SubmitFrame();
26 : void GetDOMLayers(nsTArray<dom::VRLayer>& result);
27 : uint32_t GetGroup() const;
28 :
29 : private:
30 : ~VRDisplayPresentation();
31 : void CreateLayers();
32 : void DestroyLayers();
33 :
34 : RefPtr<VRDisplayClient> mDisplayClient;
35 : nsTArray<dom::VRLayer> mDOMLayers;
36 : nsTArray<RefPtr<VRLayerChild>> mLayers;
37 : uint32_t mGroup;
38 : };
39 :
40 : } // namespace gfx
41 : } // namespace mozilla
42 :
43 : #endif /* GFX_VR_DISPLAY_PRESENTAITON_H */
|