michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GLCONTEXTPROVIDER_H_ michael@0: #define GLCONTEXTPROVIDER_H_ michael@0: michael@0: #include "GLContextTypes.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "SurfaceTypes.h" michael@0: michael@0: #include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below) michael@0: michael@0: class nsIWidget; michael@0: michael@0: namespace mozilla { michael@0: namespace gl { michael@0: michael@0: #define IN_GL_CONTEXT_PROVIDER_H michael@0: michael@0: // Null is always there michael@0: #define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull michael@0: #include "GLContextProviderImpl.h" michael@0: #undef GL_CONTEXT_PROVIDER_NAME michael@0: michael@0: #ifdef XP_WIN michael@0: #define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL michael@0: #include "GLContextProviderImpl.h" michael@0: #undef GL_CONTEXT_PROVIDER_NAME michael@0: #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL michael@0: #define DEFAULT_IMPL WGL michael@0: #endif michael@0: michael@0: #ifdef XP_MACOSX michael@0: #define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL michael@0: #include "GLContextProviderImpl.h" michael@0: #undef GL_CONTEXT_PROVIDER_NAME michael@0: #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL michael@0: #endif michael@0: michael@0: #if defined(ANDROID) || defined(XP_WIN) michael@0: #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL michael@0: #include "GLContextProviderImpl.h" michael@0: #undef GL_CONTEXT_PROVIDER_NAME michael@0: #ifndef GL_CONTEXT_PROVIDER_DEFAULT michael@0: #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL michael@0: #endif michael@0: #endif michael@0: michael@0: #ifdef MOZ_GL_PROVIDER michael@0: #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER michael@0: #include "GLContextProviderImpl.h" michael@0: #undef GL_CONTEXT_PROVIDER_NAME michael@0: #define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER michael@0: #endif michael@0: michael@0: #if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT) michael@0: #define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX michael@0: #include "GLContextProviderImpl.h" michael@0: #undef GL_CONTEXT_PROVIDER_NAME michael@0: #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX michael@0: #endif michael@0: michael@0: #ifdef GL_CONTEXT_PROVIDER_DEFAULT michael@0: typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider; michael@0: #else michael@0: typedef GLContextProviderNull GLContextProvider; michael@0: #endif michael@0: michael@0: #undef IN_GL_CONTEXT_PROVIDER_H michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif