tor-browser

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

TextureClientSharedSurface.h (2281B)


      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_TEXTURECLIENT_SHAREDSURFACE_H
      8 #define MOZILLA_GFX_TEXTURECLIENT_SHAREDSURFACE_H
      9 
     10 #include <cstddef>           // for size_t
     11 #include <stdint.h>          // for uint32_t, uint8_t, uint64_t
     12 #include "GLContextTypes.h"  // for GLContext (ptr only), etc
     13 #include "TextureClient.h"
     14 #include "mozilla/Assertions.h"              // for MOZ_ASSERT, etc
     15 #include "mozilla/RefPtr.h"                  // for RefPtr, RefCounted
     16 #include "mozilla/gfx/Point.h"               // for IntSize
     17 #include "mozilla/gfx/Types.h"               // for SurfaceFormat
     18 #include "mozilla/layers/CompositorTypes.h"  // for TextureFlags, etc
     19 #include "mozilla/layers/LayersSurfaces.h"   // for SurfaceDescriptor
     20 
     21 namespace mozilla {
     22 namespace gl {
     23 class GLContext;
     24 class SharedSurface;
     25 class SurfaceFactory;
     26 }  // namespace gl
     27 
     28 namespace layers {
     29 
     30 class SharedSurfaceTextureClient;
     31 
     32 class SharedSurfaceTextureData : public TextureData {
     33  friend class SharedSurfaceTextureClient;
     34 
     35 public:
     36  const SurfaceDescriptor mDesc;
     37  const gfx::SurfaceFormat mFormat;
     38  const gfx::IntSize mSize;
     39 
     40  static already_AddRefed<TextureClient> CreateTextureClient(
     41      const layers::SurfaceDescriptor& aDesc, const gfx::SurfaceFormat aFormat,
     42      gfx::IntSize aSize, TextureFlags aFlags, LayersIPCChannel* aAllocator);
     43 
     44  SharedSurfaceTextureData(const SurfaceDescriptor&, gfx::SurfaceFormat,
     45                           gfx::IntSize);
     46  virtual ~SharedSurfaceTextureData();
     47 
     48  bool Lock(OpenMode) override { return false; }
     49 
     50  void Unlock() override {}
     51 
     52  void FillInfo(TextureData::Info& aInfo) const override;
     53 
     54  bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
     55 
     56  void Deallocate(LayersIPCChannel*) override;
     57 
     58  TextureFlags GetTextureFlags() const override;
     59 
     60  Maybe<uint64_t> GetBufferId() const override;
     61 
     62  UniqueFileHandle GetAcquireFence() override;
     63 };
     64 
     65 }  // namespace layers
     66 }  // namespace mozilla
     67 
     68 #endif  // MOZILLA_GFX_TEXTURECLIENT_SHAREDSURFACE_H