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/webgpu/ExternalTexture.h"
11 struct ID3D11Texture2D
;
17 class ExternalTextureD3D11 final
: public ExternalTexture
{
19 static UniquePtr
<ExternalTextureD3D11
> Create(
20 const uint32_t aWidth
, const uint32_t aHeight
,
21 const struct ffi::WGPUTextureFormat aFormat
);
23 ExternalTextureD3D11(const uint32_t aWidth
, const uint32_t aHeight
,
24 const struct ffi::WGPUTextureFormat aFormat
,
25 RefPtr
<ID3D11Texture2D
> aTexture
);
26 virtual ~ExternalTextureD3D11();
28 void* GetExternalTextureHandle() override
;
30 Maybe
<layers::SurfaceDescriptor
> ToSurfaceDescriptor() override
;
33 RefPtr
<ID3D11Texture2D
> mTexture
;
37 } // namespace mozilla
39 #endif // GPU_Texture_H_