Bug 1433081 - Don't try to build different GL backends when MOZ_GL_PROVIDER is set, r?jgilbert
--with-gl-provider build option is recently broken as we try to build different GL backends
regardless the MOZ_GL_PROVIDER variable. With this patch when --with-gl-provider is gived we build
the specified GL backend only.
It aims primary to Wayland on Gtk/Linux where GLX is default and we need to explicitly
build against EGL.
MozReview-Commit-ID: KhzY2Ahldcm
--- a/gfx/gl/GLContextProvider.h
+++ b/gfx/gl/GLContextProvider.h
@@ -21,16 +21,24 @@ namespace gl {
#define IN_GL_CONTEXT_PROVIDER_H
// Null is always there
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
#include "GLContextProviderImpl.h"
#undef GL_CONTEXT_PROVIDER_NAME
+#ifdef MOZ_GL_PROVIDER
+ #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
+ #include "GLContextProviderImpl.h"
+ #undef GL_CONTEXT_PROVIDER_NAME
+ #define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
+
+#else // MOZ_GL_PROVIDER
+
#ifdef XP_WIN
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
#include "GLContextProviderImpl.h"
#undef GL_CONTEXT_PROVIDER_NAME
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL
#define DEFAULT_IMPL WGL
#endif
@@ -59,22 +67,17 @@ namespace gl {
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEAGL
#include "GLContextProviderImpl.h"
#undef GL_CONTEXT_PROVIDER_NAME
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEAGL
#endif
#endif
-#ifdef MOZ_GL_PROVIDER
- #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
- #include "GLContextProviderImpl.h"
- #undef GL_CONTEXT_PROVIDER_NAME
- #define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
-#endif
+#endif // MOZ_GL_PROVIDER
#ifdef GL_CONTEXT_PROVIDER_DEFAULT
typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
#else
typedef GLContextProviderNull GLContextProvider;
#endif
#undef IN_GL_CONTEXT_PROVIDER_H