Bug 1860298 [wpt PR 42668] - [FedCM] Check "same origin with ancestors" for subresour...
[gecko.git] / gfx / layers / IMFYCbCrImage.h
blobe1df0b209922e127bd6ba291b6cfa733145d3ba9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_IMFYCBCRIMAGE_H
8 #define GFX_IMFYCBCRIMAGE_H
10 #include "mozilla/layers/TextureD3D11.h"
11 #include "mozilla/RefPtr.h"
12 #include "ImageContainer.h"
13 #include "mfidl.h"
15 namespace mozilla {
16 namespace layers {
18 class IMFYCbCrImage : public RecyclingPlanarYCbCrImage {
19 public:
20 IMFYCbCrImage(IMFMediaBuffer* aBuffer, IMF2DBuffer* a2DBuffer,
21 KnowsCompositor* aKnowsCompositor, ImageContainer* aContainer);
23 bool IsValid() const override { return true; }
25 TextureClient* GetTextureClient(KnowsCompositor* aKnowsCompositor) override;
27 protected:
28 TextureClient* GetD3D11TextureClient(KnowsCompositor* aKnowsCompositor);
29 static bool CopyDataToTexture(const Data& aData, ID3D11Device* aDevice,
30 DXGIYCbCrTextureData* aTextureData);
32 virtual ~IMFYCbCrImage();
34 RefPtr<IMFMediaBuffer> mBuffer;
35 RefPtr<IMF2DBuffer> m2DBuffer;
36 RefPtr<D3D11YCbCrRecycleAllocator> mAllocator;
37 RefPtr<TextureClient> mTextureClient;
40 } // namespace layers
41 } // namespace mozilla
43 #endif // GFX_D3DSURFACEIMAGE_H