Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef GLCONTEXTPROVIDER_H_ |
michael@0 | 7 | #define GLCONTEXTPROVIDER_H_ |
michael@0 | 8 | |
michael@0 | 9 | #include "GLContextTypes.h" |
michael@0 | 10 | #include "nsAutoPtr.h" |
michael@0 | 11 | #include "SurfaceTypes.h" |
michael@0 | 12 | |
michael@0 | 13 | #include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below) |
michael@0 | 14 | |
michael@0 | 15 | class nsIWidget; |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | namespace gl { |
michael@0 | 19 | |
michael@0 | 20 | #define IN_GL_CONTEXT_PROVIDER_H |
michael@0 | 21 | |
michael@0 | 22 | // Null is always there |
michael@0 | 23 | #define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull |
michael@0 | 24 | #include "GLContextProviderImpl.h" |
michael@0 | 25 | #undef GL_CONTEXT_PROVIDER_NAME |
michael@0 | 26 | |
michael@0 | 27 | #ifdef XP_WIN |
michael@0 | 28 | #define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL |
michael@0 | 29 | #include "GLContextProviderImpl.h" |
michael@0 | 30 | #undef GL_CONTEXT_PROVIDER_NAME |
michael@0 | 31 | #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL |
michael@0 | 32 | #define DEFAULT_IMPL WGL |
michael@0 | 33 | #endif |
michael@0 | 34 | |
michael@0 | 35 | #ifdef XP_MACOSX |
michael@0 | 36 | #define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL |
michael@0 | 37 | #include "GLContextProviderImpl.h" |
michael@0 | 38 | #undef GL_CONTEXT_PROVIDER_NAME |
michael@0 | 39 | #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL |
michael@0 | 40 | #endif |
michael@0 | 41 | |
michael@0 | 42 | #if defined(ANDROID) || defined(XP_WIN) |
michael@0 | 43 | #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL |
michael@0 | 44 | #include "GLContextProviderImpl.h" |
michael@0 | 45 | #undef GL_CONTEXT_PROVIDER_NAME |
michael@0 | 46 | #ifndef GL_CONTEXT_PROVIDER_DEFAULT |
michael@0 | 47 | #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL |
michael@0 | 48 | #endif |
michael@0 | 49 | #endif |
michael@0 | 50 | |
michael@0 | 51 | #ifdef MOZ_GL_PROVIDER |
michael@0 | 52 | #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER |
michael@0 | 53 | #include "GLContextProviderImpl.h" |
michael@0 | 54 | #undef GL_CONTEXT_PROVIDER_NAME |
michael@0 | 55 | #define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER |
michael@0 | 56 | #endif |
michael@0 | 57 | |
michael@0 | 58 | #if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT) |
michael@0 | 59 | #define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX |
michael@0 | 60 | #include "GLContextProviderImpl.h" |
michael@0 | 61 | #undef GL_CONTEXT_PROVIDER_NAME |
michael@0 | 62 | #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX |
michael@0 | 63 | #endif |
michael@0 | 64 | |
michael@0 | 65 | #ifdef GL_CONTEXT_PROVIDER_DEFAULT |
michael@0 | 66 | typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider; |
michael@0 | 67 | #else |
michael@0 | 68 | typedef GLContextProviderNull GLContextProvider; |
michael@0 | 69 | #endif |
michael@0 | 70 | |
michael@0 | 71 | #undef IN_GL_CONTEXT_PROVIDER_H |
michael@0 | 72 | |
michael@0 | 73 | } |
michael@0 | 74 | } |
michael@0 | 75 | |
michael@0 | 76 | #endif |