2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2017-10-28 01:55:37 +03:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2016-02-25 02:54:50 +03:00
|
|
|
|
|
|
|
#ifndef GFX_VR_DISPLAY_PRESENTATION_H
|
|
|
|
#define GFX_VR_DISPLAY_PRESENTATION_H
|
|
|
|
|
|
|
|
#include "mozilla/RefPtr.h"
|
|
|
|
#include "mozilla/dom/VRDisplayBinding.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
class VRDisplayClient;
|
|
|
|
class VRLayerChild;
|
|
|
|
|
|
|
|
class VRDisplayPresentation final {
|
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRDisplayPresentation)
|
|
|
|
|
|
|
|
public:
|
2017-05-09 02:01:36 +03:00
|
|
|
VRDisplayPresentation(VRDisplayClient* aDisplayClient,
|
|
|
|
const nsTArray<dom::VRLayer>& aLayers, uint32_t aGroup);
|
2017-08-29 02:20:59 +03:00
|
|
|
void UpdateLayers(const nsTArray<mozilla::dom::VRLayer>& aLayers);
|
2016-10-01 02:43:24 +03:00
|
|
|
void SubmitFrame();
|
2016-02-25 02:54:50 +03:00
|
|
|
void GetDOMLayers(nsTArray<dom::VRLayer>& result);
|
2017-05-09 02:01:36 +03:00
|
|
|
uint32_t GetGroup() const;
|
2016-02-25 02:54:50 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
~VRDisplayPresentation();
|
|
|
|
void CreateLayers();
|
|
|
|
void DestroyLayers();
|
|
|
|
|
|
|
|
RefPtr<VRDisplayClient> mDisplayClient;
|
|
|
|
nsTArray<dom::VRLayer> mDOMLayers;
|
|
|
|
nsTArray<RefPtr<VRLayerChild>> mLayers;
|
2017-05-09 02:01:36 +03:00
|
|
|
uint32_t mGroup;
|
2016-02-25 02:54:50 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gfx
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* GFX_VR_DISPLAY_PRESENTAITON_H */
|