Bug 1466775 - [Wayland] Configure WebRender on X11, r?jhorak
MozReview-Commit-ID: ChXp7m5XeOI
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3708,17 +3708,17 @@ nsWindow::Create(nsIWidget* aParent,
bool useAlphaVisual = (mWindowType == eWindowType_popup &&
aInitData->mSupportTranslucency);
// mozilla.widget.use-argb-visuals is a hidden pref defaulting to false
// to allow experimentation
if (Preferences::GetBool("mozilla.widget.use-argb-visuals", false))
useAlphaVisual = true;
-#ifdef GL_PROVIDER_GLX
+#ifdef MOZ_X11
// Ensure gfxPlatform is initialized, since that is what initializes
// gfxVars, used below.
Unused << gfxPlatform::GetPlatform();
bool useWebRender = gfx::gfxVars::UseWebRender() &&
AllowWebRenderForThisWindow();
// If using WebRender on X11, we need to select a visual with a depth buffer,
@@ -3735,17 +3735,17 @@ nsWindow::Create(nsIWidget* aParent,
&visualId)) {
// If we're using CSD, rendering will go through mContainer, but
// it will inherit this visual as it is a child of mShell.
gtk_widget_set_visual(mShell,
gdk_x11_screen_lookup_visual(screen,
visualId));
}
} else
-#endif // GL_PROVIDER_GLX
+#endif // MOZ_X11
{
if (useAlphaVisual) {
GdkScreen *screen = gtk_widget_get_screen(mShell);
if (gdk_screen_is_composited(screen)) {
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
gtk_widget_set_visual(mShell, visual);
}
}