2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/. */
|
2010-04-27 06:09:44 +04:00
|
|
|
|
|
|
|
#ifndef GLCONTEXTPROVIDER_H_
|
|
|
|
#define GLCONTEXTPROVIDER_H_
|
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
#include "mozilla/AlreadyAddRefed.h"
|
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
#include "GLContextTypes.h"
|
2013-02-14 03:26:24 +04:00
|
|
|
#include "SurfaceTypes.h"
|
2010-04-27 06:09:44 +04:00
|
|
|
|
2015-05-28 12:45:33 +03:00
|
|
|
#include "nsSize.h" // for gfx::IntSize (needed by GLContextProviderImpl.h below)
|
2020-11-23 19:21:38 +03:00
|
|
|
#include "nsStringFwd.h" // needed by GLContextProviderImpl.h below
|
2014-04-16 04:41:40 +04:00
|
|
|
|
2010-04-27 06:09:44 +04:00
|
|
|
class nsIWidget;
|
|
|
|
|
|
|
|
namespace mozilla {
|
2016-07-25 21:41:00 +03:00
|
|
|
namespace widget {
|
|
|
|
class CompositorWidget;
|
|
|
|
}
|
2010-04-27 06:09:44 +04:00
|
|
|
namespace gl {
|
|
|
|
|
2010-07-19 09:01:14 +04:00
|
|
|
#define IN_GL_CONTEXT_PROVIDER_H
|
|
|
|
|
2012-09-08 02:35:22 +04:00
|
|
|
// Null is always there
|
2010-07-19 09:01:14 +04:00
|
|
|
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
|
|
|
|
#include "GLContextProviderImpl.h"
|
|
|
|
#undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
2015-09-24 22:21:05 +03:00
|
|
|
# define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
|
|
|
|
# include "GLContextProviderImpl.h"
|
|
|
|
# undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL
|
|
|
|
# define DEFAULT_IMPL WGL
|
2010-07-19 09:01:14 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef XP_MACOSX
|
2015-09-24 22:21:05 +03:00
|
|
|
# define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
|
|
|
|
# include "GLContextProviderImpl.h"
|
|
|
|
# undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
|
|
|
|
#endif
|
|
|
|
|
2020-07-02 16:50:41 +03:00
|
|
|
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
|
|
|
|
#include "GLContextProviderImpl.h"
|
|
|
|
#undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
|
2018-05-15 17:16:19 +03:00
|
|
|
#if defined(MOZ_X11)
|
2015-09-24 22:21:05 +03:00
|
|
|
# define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
|
|
|
|
# include "GLContextProviderImpl.h"
|
|
|
|
# undef GL_CONTEXT_PROVIDER_NAME
|
2020-07-02 16:50:41 +03:00
|
|
|
# define GL_CONTEXT_PROVIDER_NAME GLContextProviderX11
|
|
|
|
# include "GLContextProviderImpl.h"
|
|
|
|
# undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
# if defined(MOZ_WAYLAND)
|
|
|
|
# define GL_CONTEXT_PROVIDER_NAME GLContextProviderWayland
|
|
|
|
# include "GLContextProviderImpl.h"
|
|
|
|
# undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWayland
|
|
|
|
# endif
|
|
|
|
# ifndef GL_CONTEXT_PROVIDER_DEFAULT
|
|
|
|
# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderX11
|
|
|
|
# endif
|
2010-07-19 09:01:14 +04:00
|
|
|
#endif
|
|
|
|
|
2010-08-07 09:09:18 +04:00
|
|
|
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
|
2015-09-24 22:21:05 +03:00
|
|
|
# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
|
2010-08-07 09:09:18 +04:00
|
|
|
#endif
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2015-09-29 01:09:56 +03:00
|
|
|
#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
|
|
|
|
|
2013-04-30 07:16:04 +04:00
|
|
|
#ifdef MOZ_GL_PROVIDER
|
2015-09-24 22:21:05 +03:00
|
|
|
# define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
|
|
|
|
# include "GLContextProviderImpl.h"
|
|
|
|
# undef GL_CONTEXT_PROVIDER_NAME
|
|
|
|
# define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
|
2012-03-23 22:43:52 +04:00
|
|
|
#endif
|
|
|
|
|
2010-07-19 09:01:14 +04:00
|
|
|
#ifdef GL_CONTEXT_PROVIDER_DEFAULT
|
2015-09-24 22:21:05 +03:00
|
|
|
typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
|
2010-07-19 09:01:14 +04:00
|
|
|
#else
|
2015-09-24 22:21:05 +03:00
|
|
|
typedef GLContextProviderNull GLContextProvider;
|
2010-07-19 09:01:14 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef IN_GL_CONTEXT_PROVIDER_H
|
2010-04-27 06:09:44 +04:00
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gl
|
|
|
|
} // namespace mozilla
|
2010-04-27 06:09:44 +04:00
|
|
|
|
|
|
|
#endif
|