2010-04-26 19:09:44 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 04:12:37 -07: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-26 19:09:44 -07:00
|
|
|
|
|
|
|
#ifndef GLCONTEXTPROVIDER_H_
|
|
|
|
#define GLCONTEXTPROVIDER_H_
|
|
|
|
|
2013-09-04 05:14:52 -07:00
|
|
|
#include "GLContextTypes.h"
|
2010-04-26 19:09:44 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2013-02-13 15:26:24 -08:00
|
|
|
#include "SurfaceTypes.h"
|
2010-04-26 19:09:44 -07:00
|
|
|
|
2014-04-15 17:41:40 -07:00
|
|
|
#include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below)
|
|
|
|
|
2010-04-26 19:09:44 -07:00
|
|
|
class nsIWidget;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
2010-07-18 22:01:14 -07:00
|
|
|
#define IN_GL_CONTEXT_PROVIDER_H
|
|
|
|
|
2012-09-07 15:35:22 -07:00
|
|
|
// Null is always there
|
2010-07-18 22:01:14 -07:00
|
|
|
#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
|
|
|
|
|
2013-08-25 16:56:53 -07:00
|
|
|
#if defined(ANDROID) || defined(XP_WIN)
|
2010-07-18 22:01:14 -07:00
|
|
|
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
|
|
|
|
#include "GLContextProviderImpl.h"
|
|
|
|
#undef GL_CONTEXT_PROVIDER_NAME
|
2010-08-06 22:09:18 -07:00
|
|
|
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
|
2010-07-18 22:01:14 -07:00
|
|
|
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
|
|
|
|
#endif
|
2010-08-06 22:09:18 -07:00
|
|
|
#endif
|
2010-07-18 22:01:14 -07:00
|
|
|
|
2013-04-29 20:16:04 -07:00
|
|
|
#ifdef MOZ_GL_PROVIDER
|
|
|
|
#define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
|
2010-07-18 22:01:14 -07:00
|
|
|
#include "GLContextProviderImpl.h"
|
|
|
|
#undef GL_CONTEXT_PROVIDER_NAME
|
2013-04-29 20:16:04 -07:00
|
|
|
#define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
|
2010-07-18 22:01:14 -07:00
|
|
|
#endif
|
|
|
|
|
2013-04-29 20:16:04 -07:00
|
|
|
#if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
|
|
|
|
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
|
2012-03-23 11:43:52 -07:00
|
|
|
#include "GLContextProviderImpl.h"
|
|
|
|
#undef GL_CONTEXT_PROVIDER_NAME
|
2013-04-29 20:16:04 -07:00
|
|
|
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX
|
2012-03-23 11:43:52 -07:00
|
|
|
#endif
|
|
|
|
|
2010-07-18 22:01:14 -07:00
|
|
|
#ifdef GL_CONTEXT_PROVIDER_DEFAULT
|
|
|
|
typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
|
|
|
|
#else
|
|
|
|
typedef GLContextProviderNull GLContextProvider;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef IN_GL_CONTEXT_PROVIDER_H
|
2010-04-26 19:09:44 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|