|
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
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/. */ |
|
5 |
|
6 #ifndef GLCONTEXTPROVIDER_H_ |
|
7 #define GLCONTEXTPROVIDER_H_ |
|
8 |
|
9 #include "GLContextTypes.h" |
|
10 #include "nsAutoPtr.h" |
|
11 #include "SurfaceTypes.h" |
|
12 |
|
13 #include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below) |
|
14 |
|
15 class nsIWidget; |
|
16 |
|
17 namespace mozilla { |
|
18 namespace gl { |
|
19 |
|
20 #define IN_GL_CONTEXT_PROVIDER_H |
|
21 |
|
22 // Null is always there |
|
23 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull |
|
24 #include "GLContextProviderImpl.h" |
|
25 #undef GL_CONTEXT_PROVIDER_NAME |
|
26 |
|
27 #ifdef XP_WIN |
|
28 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL |
|
29 #include "GLContextProviderImpl.h" |
|
30 #undef GL_CONTEXT_PROVIDER_NAME |
|
31 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL |
|
32 #define DEFAULT_IMPL WGL |
|
33 #endif |
|
34 |
|
35 #ifdef XP_MACOSX |
|
36 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL |
|
37 #include "GLContextProviderImpl.h" |
|
38 #undef GL_CONTEXT_PROVIDER_NAME |
|
39 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL |
|
40 #endif |
|
41 |
|
42 #if defined(ANDROID) || defined(XP_WIN) |
|
43 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL |
|
44 #include "GLContextProviderImpl.h" |
|
45 #undef GL_CONTEXT_PROVIDER_NAME |
|
46 #ifndef GL_CONTEXT_PROVIDER_DEFAULT |
|
47 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL |
|
48 #endif |
|
49 #endif |
|
50 |
|
51 #ifdef MOZ_GL_PROVIDER |
|
52 #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER |
|
53 #include "GLContextProviderImpl.h" |
|
54 #undef GL_CONTEXT_PROVIDER_NAME |
|
55 #define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER |
|
56 #endif |
|
57 |
|
58 #if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT) |
|
59 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX |
|
60 #include "GLContextProviderImpl.h" |
|
61 #undef GL_CONTEXT_PROVIDER_NAME |
|
62 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX |
|
63 #endif |
|
64 |
|
65 #ifdef GL_CONTEXT_PROVIDER_DEFAULT |
|
66 typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider; |
|
67 #else |
|
68 typedef GLContextProviderNull GLContextProvider; |
|
69 #endif |
|
70 |
|
71 #undef IN_GL_CONTEXT_PROVIDER_H |
|
72 |
|
73 } |
|
74 } |
|
75 |
|
76 #endif |