FxROutputHandler.h (977B)
1 /* -*- Mode: C++; tab-width: 2; 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 #pragma once 7 8 struct ID3D11Texture2D; 9 struct IDXGISwapChain; 10 struct ID3D11DeviceContext; 11 struct ID3D11Device; 12 13 #include <windows.h> 14 #include <d3d11_1.h> 15 16 #include "mozilla/RefPtr.h" 17 18 // FxROutputHandler is responsible for managing resources to share a Desktop 19 // browser window with a Firefox Reality VR window. 20 // Note: this object is created on the Compositor thread, but its usage should 21 // only be on the RenderThread. 22 class FxROutputHandler final { 23 public: 24 bool TryInitialize(IDXGISwapChain* aSwapChain, ID3D11Device* aDevice); 25 void UpdateOutput(ID3D11DeviceContext* aCtx); 26 27 private: 28 RefPtr<IDXGISwapChain> mSwapChain = nullptr; 29 RefPtr<ID3D11Texture2D> mTexCopy = nullptr; 30 };