Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release
[gecko.git] / gfx / gl / GLContextProvider.h
blob277b76efa856ef86c7b4d57ddaaf5965bc19ea03
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GLCONTEXTPROVIDER_H_
7 #define GLCONTEXTPROVIDER_H_
9 #include "mozilla/AlreadyAddRefed.h"
11 #include "GLContextTypes.h"
12 #include "SurfaceTypes.h"
14 #include "nsSize.h" // for gfx::IntSize (needed by GLContextProviderImpl.h below)
15 #include "nsStringFwd.h" // needed by GLContextProviderImpl.h below
17 class nsIWidget;
19 namespace mozilla {
20 namespace widget {
21 class CompositorWidget;
23 namespace gl {
25 #define IN_GL_CONTEXT_PROVIDER_H
27 // Null is always there
28 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
29 #include "GLContextProviderImpl.h"
30 #undef GL_CONTEXT_PROVIDER_NAME
32 #ifdef XP_WIN
33 # define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
34 # include "GLContextProviderImpl.h"
35 # undef GL_CONTEXT_PROVIDER_NAME
36 # define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL
37 # define DEFAULT_IMPL WGL
38 #endif
40 #ifdef XP_MACOSX
41 # define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
42 # include "GLContextProviderImpl.h"
43 # undef GL_CONTEXT_PROVIDER_NAME
44 # define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
45 #endif
47 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
48 #include "GLContextProviderImpl.h"
49 #undef GL_CONTEXT_PROVIDER_NAME
51 #if defined(MOZ_WIDGET_GTK)
52 # ifdef MOZ_X11
53 # define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
54 # include "GLContextProviderImpl.h"
55 # undef GL_CONTEXT_PROVIDER_NAME
56 # endif
57 # define GL_CONTEXT_PROVIDER_NAME GLContextProviderLinux
58 # include "GLContextProviderImpl.h"
59 # undef GL_CONTEXT_PROVIDER_NAME
60 # define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderLinux
61 #endif
63 #if defined(MOZ_WIDGET_UIKIT)
64 # define GL_CONTEXT_PROVIDER_NAME GLContextProviderEAGL
65 # include "GLContextProviderImpl.h"
66 # undef GL_CONTEXT_PROVIDER_NAME
67 # ifndef GL_CONTEXT_PROVIDER_DEFAULT
68 # define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEAGL
69 # endif
70 #endif
72 #ifndef GL_CONTEXT_PROVIDER_DEFAULT
73 # define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
74 #endif
76 #ifdef MOZ_GL_PROVIDER
77 # define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
78 # include "GLContextProviderImpl.h"
79 # undef GL_CONTEXT_PROVIDER_NAME
80 # define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
81 #endif
83 #ifdef GL_CONTEXT_PROVIDER_DEFAULT
84 typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
85 #else
86 typedef GLContextProviderNull GLContextProvider;
87 #endif
89 #undef IN_GL_CONTEXT_PROVIDER_H
91 } // namespace gl
92 } // namespace mozilla
94 #endif