gfx/gl/GLContextProvider.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/gl/GLContextProvider.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,76 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef GLCONTEXTPROVIDER_H_
    1.10 +#define GLCONTEXTPROVIDER_H_
    1.11 +
    1.12 +#include "GLContextTypes.h"
    1.13 +#include "nsAutoPtr.h"
    1.14 +#include "SurfaceTypes.h"
    1.15 +
    1.16 +#include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below)
    1.17 +
    1.18 +class nsIWidget;
    1.19 +
    1.20 +namespace mozilla {
    1.21 +namespace gl {
    1.22 +
    1.23 +#define IN_GL_CONTEXT_PROVIDER_H
    1.24 +
    1.25 +// Null is always there
    1.26 +#define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
    1.27 +#include "GLContextProviderImpl.h"
    1.28 +#undef GL_CONTEXT_PROVIDER_NAME
    1.29 +
    1.30 +#ifdef XP_WIN
    1.31 +#define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
    1.32 +#include "GLContextProviderImpl.h"
    1.33 +#undef GL_CONTEXT_PROVIDER_NAME
    1.34 +#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL
    1.35 +#define DEFAULT_IMPL WGL
    1.36 +#endif
    1.37 +
    1.38 +#ifdef XP_MACOSX
    1.39 +#define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
    1.40 +#include "GLContextProviderImpl.h"
    1.41 +#undef GL_CONTEXT_PROVIDER_NAME
    1.42 +#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
    1.43 +#endif
    1.44 +
    1.45 +#if defined(ANDROID) || defined(XP_WIN)
    1.46 +#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
    1.47 +#include "GLContextProviderImpl.h"
    1.48 +#undef GL_CONTEXT_PROVIDER_NAME
    1.49 +#ifndef GL_CONTEXT_PROVIDER_DEFAULT
    1.50 +#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
    1.51 +#endif
    1.52 +#endif
    1.53 +
    1.54 +#ifdef MOZ_GL_PROVIDER
    1.55 +#define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
    1.56 +#include "GLContextProviderImpl.h"
    1.57 +#undef GL_CONTEXT_PROVIDER_NAME
    1.58 +#define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
    1.59 +#endif
    1.60 +
    1.61 +#if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
    1.62 +#define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
    1.63 +#include "GLContextProviderImpl.h"
    1.64 +#undef GL_CONTEXT_PROVIDER_NAME
    1.65 +#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX
    1.66 +#endif
    1.67 +
    1.68 +#ifdef GL_CONTEXT_PROVIDER_DEFAULT
    1.69 +typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
    1.70 +#else
    1.71 +typedef GLContextProviderNull GLContextProvider;
    1.72 +#endif
    1.73 +
    1.74 +#undef IN_GL_CONTEXT_PROVIDER_H
    1.75 +
    1.76 +}
    1.77 +}
    1.78 +
    1.79 +#endif

mercurial