tor-browser

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

GPUVideoTextureClient.h (1576B)


      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 MOZILLA_GFX_GPUVIDEOTEXTURECLIENT_H
      8 #define MOZILLA_GFX_GPUVIDEOTEXTURECLIENT_H
      9 
     10 #include "mozilla/layers/TextureClient.h"
     11 
     12 namespace mozilla {
     13 namespace gfx {
     14 class SourceSurface;
     15 }
     16 
     17 namespace layers {
     18 class IGPUVideoSurfaceManager;
     19 
     20 class GPUVideoTextureData : public TextureData {
     21 public:
     22  GPUVideoTextureData(IGPUVideoSurfaceManager* aManager,
     23                      const SurfaceDescriptorGPUVideo& aSD,
     24                      const gfx::IntSize& aSize);
     25  virtual ~GPUVideoTextureData();
     26 
     27  void FillInfo(TextureData::Info& aInfo) const override;
     28 
     29  bool Lock(OpenMode) override { return true; };
     30 
     31  void Unlock() override {};
     32 
     33  bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
     34 
     35  void Deallocate(LayersIPCChannel* aAllocator) override;
     36 
     37  void Forget(LayersIPCChannel* aAllocator) override;
     38 
     39  already_AddRefed<gfx::SourceSurface> GetAsSourceSurface();
     40 
     41  void OnSetCurrent();
     42 
     43  GPUVideoTextureData* AsGPUVideoTextureData() override { return this; }
     44 
     45 protected:
     46  RefPtr<IGPUVideoSurfaceManager> mManager;
     47  SurfaceDescriptorGPUVideo mSD;
     48  gfx::IntSize mSize;
     49 
     50 public:
     51  const decltype(mSD)& SD() const { return mSD; }
     52 };
     53 
     54 }  // namespace layers
     55 }  // namespace mozilla
     56 
     57 #endif  // MOZILLA_GFX_GPUVIDEOTEXTURECLIENT_H