no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / webgpu / ExternalTextureD3D11.h
blobf6e0678d51bfe6c9289e5420e4965f7a16f0e9d6
1 /* -*- Mode: C++; tab-width: 4; 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/. */
6 #ifndef GPU_ExternalTextureD3D11_H_
7 #define GPU_ExternalTextureD3D11_H_
9 #include "mozilla/gfx/FileHandleWrapper.h"
10 #include "mozilla/webgpu/ExternalTexture.h"
12 struct ID3D11Texture2D;
14 namespace mozilla {
16 namespace webgpu {
18 class ExternalTextureD3D11 final : public ExternalTexture {
19 public:
20 static UniquePtr<ExternalTextureD3D11> Create(
21 const uint32_t aWidth, const uint32_t aHeight,
22 const struct ffi::WGPUTextureFormat aFormat,
23 const ffi::WGPUTextureUsages aUsage);
25 ExternalTextureD3D11(const uint32_t aWidth, const uint32_t aHeight,
26 const struct ffi::WGPUTextureFormat aFormat,
27 const ffi::WGPUTextureUsages aUsage,
28 const RefPtr<ID3D11Texture2D> aTexture,
29 RefPtr<gfx::FileHandleWrapper>&& aSharedHandle);
30 virtual ~ExternalTextureD3D11();
32 void* GetExternalTextureHandle() override;
34 Maybe<layers::SurfaceDescriptor> ToSurfaceDescriptor() override;
36 void GetSnapshot(const ipc::Shmem& aDestShmem,
37 const gfx::IntSize& aSize) override;
39 protected:
40 const RefPtr<ID3D11Texture2D> mTexture;
41 const RefPtr<gfx::FileHandleWrapper> mSharedHandle;
44 } // namespace webgpu
45 } // namespace mozilla
47 #endif // GPU_Texture_H_