tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

D3D11YCbCrImage.h (1699B)


      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/. */
      6 
      7 #ifndef GFX_D3D11_YCBCR_IMAGE_H
      8 #define GFX_D3D11_YCBCR_IMAGE_H
      9 
     10 #include "d3d11.h"
     11 #include "mozilla/layers/TextureClientRecycleAllocator.h"
     12 #include "ImageContainer.h"
     13 
     14 namespace mozilla {
     15 namespace gl {
     16 class GLBlitHelper;
     17 }
     18 namespace layers {
     19 
     20 class ImageContainer;
     21 class DXGIYCbCrTextureClient;
     22 class DXGIYCbCrTextureData;
     23 
     24 class MOZ_RAII DXGIYCbCrTextureAllocationHelper
     25    : public ITextureClientAllocationHelper {
     26 public:
     27  DXGIYCbCrTextureAllocationHelper(const PlanarYCbCrData& aData,
     28                                   TextureFlags aTextureFlags,
     29                                   ID3D11Device* aDevice);
     30 
     31  bool IsCompatible(TextureClient* aTextureClient) override;
     32 
     33  already_AddRefed<TextureClient> Allocate(
     34      KnowsCompositor* aAllocator) override;
     35 
     36 protected:
     37  const PlanarYCbCrData& mData;
     38  RefPtr<ID3D11Device> mDevice;
     39 };
     40 
     41 class D3D11YCbCrRecycleAllocator : public TextureClientRecycleAllocator {
     42 public:
     43  explicit D3D11YCbCrRecycleAllocator(KnowsCompositor* aKnowsCompositor)
     44      : TextureClientRecycleAllocator(aKnowsCompositor) {}
     45 
     46 protected:
     47  already_AddRefed<TextureClient> Allocate(
     48      gfx::SurfaceFormat aFormat, gfx::IntSize aSize, BackendSelector aSelector,
     49      TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) override;
     50 };
     51 
     52 }  // namespace layers
     53 }  // namespace mozilla
     54 
     55 #endif  // GFX_D3D11_YCBCR_IMAGE_H