Files
tubestation/gfx/gl/GLContextProvider.h
Mike Hommey ce022b4d5f Bug 1884836 - Base graphics support for iOS. r=gfx-reviewers,bradwerth
Original work by Nika Layzell and Ted Mielczarek.

Of note:
- GLdouble and GLclampd are not defined in the iPhoneOS SDK opengl
  headers.
- GL_CONTEXT_PROVIDER_DEFAULT was defined too early for
  GLContextProviderEAGL to be used as intended.
- GLContextProviderEAGL::CreateForCompositorWidget was aligned with
  GLContextProviderCGL::CreateForCompositorWidget. There is a ton of
  overlap between both, but sharing more code was left out of scope.
- MacIOSurface::BindTexImage and
  SurfacePoolCA::LockedPool::GetFramebufferForSurface were left
  unimplemented.
- RootSnapshotter is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D204323
2024-03-15 01:28:27 +00:00

95 lines
2.6 KiB
C++

/* -*- 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
#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
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
# define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
#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