From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- gfx/gl/SharedSurfaceANGLE.h | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 gfx/gl/SharedSurfaceANGLE.h (limited to 'gfx/gl/SharedSurfaceANGLE.h') diff --git a/gfx/gl/SharedSurfaceANGLE.h b/gfx/gl/SharedSurfaceANGLE.h new file mode 100644 index 0000000000..dc9697030a --- /dev/null +++ b/gfx/gl/SharedSurfaceANGLE.h @@ -0,0 +1,69 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 4; -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef SHARED_SURFACE_ANGLE_H_ +#define SHARED_SURFACE_ANGLE_H_ + +#include +#include +#include "SharedSurface.h" + +struct IDXGIKeyedMutex; +struct ID3D11Texture2D; + +namespace mozilla { +namespace gl { + +class GLContext; +class EglDisplay; + +class SharedSurface_ANGLEShareHandle final : public SharedSurface { + public: + const std::weak_ptr mEGL; + const EGLSurface mPBuffer; + const HANDLE mShareHandle; + const RefPtr mKeyedMutex; + + static UniquePtr Create( + const SharedSurfaceDesc&); + + private: + SharedSurface_ANGLEShareHandle(const SharedSurfaceDesc&, + const std::weak_ptr& egl, + EGLSurface pbuffer, HANDLE shareHandle, + const RefPtr& keyedMutex); + + public: + virtual ~SharedSurface_ANGLEShareHandle(); + + virtual void LockProdImpl() override; + virtual void UnlockProdImpl() override; + + virtual void ProducerAcquireImpl() override; + virtual void ProducerReleaseImpl() override; + virtual void ProducerReadAcquireImpl() override; + virtual void ProducerReadReleaseImpl() override; + + Maybe ToSurfaceDescriptor() override; +}; + +class SurfaceFactory_ANGLEShareHandle final : public SurfaceFactory { + public: + static UniquePtr Create(GLContext& gl); + + private: + explicit SurfaceFactory_ANGLEShareHandle(const PartialSharedSurfaceDesc& desc) + : SurfaceFactory(desc) {} + + virtual UniquePtr CreateSharedImpl( + const SharedSurfaceDesc& desc) override { + return SharedSurface_ANGLEShareHandle::Create(desc); + } +}; + +} // namespace gl +} /* namespace mozilla */ + +#endif /* SHARED_SURFACE_ANGLE_H_ */ -- cgit v1.2.3