summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContextProvider.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /gfx/gl/GLContextProvider.h
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/gl/GLContextProvider.h')
-rw-r--r--gfx/gl/GLContextProvider.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/gfx/gl/GLContextProvider.h b/gfx/gl/GLContextProvider.h
new file mode 100644
index 0000000000..c63f1ada0b
--- /dev/null
+++ b/gfx/gl/GLContextProvider.h
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * 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 GLCONTEXTPROVIDER_H_
+#define GLCONTEXTPROVIDER_H_
+
+#include "mozilla/AlreadyAddRefed.h"
+
+#include "GLContextTypes.h"
+#include "SurfaceTypes.h"
+
+#include "nsSize.h" // for gfx::IntSize (needed by GLContextProviderImpl.h below)
+#include "nsStringFwd.h" // needed by GLContextProviderImpl.h below
+
+class nsIWidget;
+
+namespace mozilla {
+namespace widget {
+class CompositorWidget;
+}
+namespace gl {
+
+#define IN_GL_CONTEXT_PROVIDER_H
+
+// Null is always there
+#define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
+#include "GLContextProviderImpl.h"
+#undef GL_CONTEXT_PROVIDER_NAME
+
+#ifdef XP_WIN
+# define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
+# include "GLContextProviderImpl.h"
+# undef GL_CONTEXT_PROVIDER_NAME
+# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL
+# define DEFAULT_IMPL WGL
+#endif
+
+#ifdef XP_MACOSX
+# define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
+# include "GLContextProviderImpl.h"
+# undef GL_CONTEXT_PROVIDER_NAME
+# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
+#endif
+
+#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
+#include "GLContextProviderImpl.h"
+#undef GL_CONTEXT_PROVIDER_NAME
+
+#if defined(MOZ_WIDGET_GTK)
+# ifdef MOZ_X11
+# define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
+# include "GLContextProviderImpl.h"
+# undef GL_CONTEXT_PROVIDER_NAME
+# endif
+# define GL_CONTEXT_PROVIDER_NAME GLContextProviderLinux
+# include "GLContextProviderImpl.h"
+# undef GL_CONTEXT_PROVIDER_NAME
+# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderLinux
+#endif
+
+#ifndef GL_CONTEXT_PROVIDER_DEFAULT
+# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
+#endif
+
+#if defined(MOZ_WIDGET_UIKIT)
+# define GL_CONTEXT_PROVIDER_NAME GLContextProviderEAGL
+# include "GLContextProviderImpl.h"
+# undef GL_CONTEXT_PROVIDER_NAME
+# ifndef GL_CONTEXT_PROVIDER_DEFAULT
+# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEAGL
+# endif
+#endif
+
+#ifdef MOZ_GL_PROVIDER
+# define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
+# include "GLContextProviderImpl.h"
+# undef GL_CONTEXT_PROVIDER_NAME
+# define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
+#endif
+
+#ifdef GL_CONTEXT_PROVIDER_DEFAULT
+typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
+#else
+typedef GLContextProviderNull GLContextProvider;
+#endif
+
+#undef IN_GL_CONTEXT_PROVIDER_H
+
+} // namespace gl
+} // namespace mozilla
+
+#endif