summaryrefslogtreecommitdiffstats
path: root/gfx/gl/SharedSurfaceGLX.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/gl/SharedSurfaceGLX.h
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/gl/SharedSurfaceGLX.h')
-rw-r--r--gfx/gl/SharedSurfaceGLX.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/gfx/gl/SharedSurfaceGLX.h b/gfx/gl/SharedSurfaceGLX.h
new file mode 100644
index 0000000000..70acfde775
--- /dev/null
+++ b/gfx/gl/SharedSurfaceGLX.h
@@ -0,0 +1,50 @@
+/* -*- 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_GLX_H_
+#define SHARED_SURFACE_GLX_H_
+
+#include "SharedSurface.h"
+#include "mozilla/RefPtr.h"
+
+class gfxXlibSurface;
+
+namespace mozilla {
+namespace gl {
+
+class SharedSurface_GLXDrawable final : public SharedSurface {
+ public:
+ const RefPtr<gfxXlibSurface> mXlibSurface;
+
+ static UniquePtr<SharedSurface_GLXDrawable> Create(const SharedSurfaceDesc&);
+
+ private:
+ SharedSurface_GLXDrawable(const SharedSurfaceDesc&,
+ const RefPtr<gfxXlibSurface>& xlibSurface);
+
+ public:
+ ~SharedSurface_GLXDrawable();
+
+ virtual void ProducerAcquireImpl() override {}
+ virtual void ProducerReleaseImpl() override;
+
+ virtual void LockProdImpl() override;
+ virtual void UnlockProdImpl() override;
+
+ Maybe<layers::SurfaceDescriptor> ToSurfaceDescriptor() override;
+};
+
+class SurfaceFactory_GLXDrawable final : public SurfaceFactory {
+ public:
+ explicit SurfaceFactory_GLXDrawable(GLContext&);
+
+ virtual UniquePtr<SharedSurface> CreateSharedImpl(
+ const SharedSurfaceDesc& desc) override;
+};
+
+} // namespace gl
+} // namespace mozilla
+
+#endif // SHARED_SURFACE_GLX_H_