Back out Bug 1401455 due to Marionette failures on a CLOSED TREE

This commit is contained in:
James Willcox 2018-03-16 11:19:01 -05:00
Родитель 446bd86ffe
Коммит 1d6a993884
5 изменённых файлов: 6 добавлений и 68 удалений

Просмотреть файл

@ -11,8 +11,6 @@
#include "GLXLibrary.h"
#include "mozilla/X11Util.h"
class gfxXlibSurface;
namespace mozilla {
namespace gl {
@ -30,10 +28,6 @@ public:
bool deleteDrawable,
gfxXlibSurface* pixmap);
static bool
FindVisual(Display* display, int screen, bool useWebRender,
bool useAlpha, int* const out_visualId);
// Finds a GLXFBConfig compatible with the provided window.
static bool
FindFBConfigForWindow(Display* display, int screen, Window window,

Просмотреть файл

@ -119,7 +119,6 @@ GLXLibrary::EnsureInitialized()
/* functions introduced in GLX 1.3 */
SYMBOL(ChooseFBConfig),
SYMBOL(ChooseVisual),
SYMBOL(GetFBConfigAttrib),
SYMBOL(GetFBConfigs),
SYMBOL(CreatePixmap),
@ -884,34 +883,6 @@ ChooseConfig(GLXLibrary* glx, Display* display, int screen, const SurfaceCaps& m
return false;
}
bool
GLContextGLX::FindVisual(Display* display, int screen, bool useWebRender,
bool useAlpha, int* const out_visualId)
{
int attribs[] = {
LOCAL_GLX_RGBA,
LOCAL_GLX_DOUBLEBUFFER,
LOCAL_GLX_RED_SIZE, 8,
LOCAL_GLX_GREEN_SIZE, 8,
LOCAL_GLX_BLUE_SIZE, 8,
LOCAL_GLX_ALPHA_SIZE, useAlpha ? 8 : 0,
LOCAL_GLX_DEPTH_SIZE, useWebRender ? 24 : 0,
LOCAL_GL_NONE
};
if (!sGLXLibrary.EnsureInitialized()) {
return false;
}
XVisualInfo* visuals = sGLXLibrary.fChooseVisual(display, screen, attribs);
if (!visuals) {
return false;
}
*out_visualId = visuals[0].visualid;
return true;
}
bool
GLContextGLX::FindFBConfigForWindow(Display* display, int screen, Window window,
ScopedXFree<GLXFBConfig>* const out_scopedConfigArr,

Просмотреть файл

@ -12,7 +12,6 @@ typedef realGLboolean GLboolean;
// stuff from glx.h
#include "X11/Xlib.h"
#include "X11/Xutil.h" // for XVisualInfo
typedef struct __GLXcontextRec* GLXContext;
typedef XID GLXPixmap;
typedef XID GLXDrawable;
@ -86,9 +85,6 @@ public:
GLXFBConfig* fChooseFBConfig(Display* display, int screen, const int* attrib_list, int* nelements) const
WRAP( fChooseFBConfig(display, screen, attrib_list, nelements) )
XVisualInfo* fChooseVisual(Display* display, int screen, int* attrib_list) const
WRAP( fChooseVisual(display, screen, attrib_list) )
GLXFBConfig* fGetFBConfigs(Display* display, int screen, int* nelements) const
WRAP( fGetFBConfigs(display, screen, nelements) )
@ -181,7 +177,6 @@ private:
GLXContext (GLAPIENTRY *fGetCurrentContext) ();
void* (GLAPIENTRY *fGetProcAddress) (const char*);
GLXFBConfig* (GLAPIENTRY *fChooseFBConfig) (Display*, int, const int*, int*);
XVisualInfo* (GLAPIENTRY *fChooseVisual) (Display*, int, const int*);
GLXFBConfig* (GLAPIENTRY *fGetFBConfigs) (Display*, int, int*);
GLXContext (GLAPIENTRY *fCreateNewContext) (Display*, GLXFBConfig, int,
GLXContext, Bool);

Просмотреть файл

@ -135,8 +135,6 @@ STUB(gdk_x11_get_xatom_by_name)
STUB(gdk_x11_get_xatom_by_name_for_display)
STUB(gdk_x11_lookup_xdisplay)
STUB(gdk_x11_screen_get_xscreen)
STUB(gdk_x11_screen_get_screen_number)
STUB(gdk_x11_screen_lookup_visual)
STUB(gdk_x11_screen_supports_net_wm_hint)
STUB(gdk_x11_visual_get_xvisual)
STUB(gdk_x11_window_foreign_new_for_display)

Просмотреть файл

@ -116,7 +116,6 @@ using namespace mozilla::widget;
#include "mozilla/layers/CompositorThread.h"
#ifdef MOZ_X11
#include "GLContextGLX.h" // for GLContextGLX::FindVisual()
#include "GtkCompositorWidget.h"
#include "gfxXlibSurface.h"
#include "WindowSurfaceX11Image.h"
@ -140,7 +139,6 @@ using namespace mozilla::gfx;
using namespace mozilla::widget;
using namespace mozilla::layers;
using mozilla::gl::GLContext;
using mozilla::gl::GLContextGLX;
// Don't put more than this many rects in the dirty region, just fluff
// out to the bounding-box if there are more
@ -3642,29 +3640,11 @@ nsWindow::Create(nsIWidget* aParent,
if (Preferences::GetBool("mozilla.widget.use-argb-visuals", false))
useAlphaVisual = true;
bool useWebRender = gfx::gfxVars::UseWebRender() &&
AllowWebRenderForThisWindow();
// If using WebRender on X11, we need to select a visual with a depth buffer,
// as well as an alpha channel if transparency is requested. This must be done
// before the widget is realized.
if (mIsX11Display && useWebRender) {
auto display =
GDK_DISPLAY_XDISPLAY(gtk_widget_get_display(mShell));
auto screen = gtk_widget_get_screen(mShell);
int screenNumber = GDK_SCREEN_XNUMBER(screen);
int visualId = 0;
if (GLContextGLX::FindVisual(display, screenNumber,
useWebRender, useAlphaVisual,
&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 if (useAlphaVisual) {
// We need to select an ARGB visual here instead of in
// SetTransparencyMode() because it has to be done before the
// widget is realized. An ARGB visual is only useful if we
// are on a compositing window manager.
if (useAlphaVisual) {
GdkScreen *screen = gtk_widget_get_screen(mShell);
if (gdk_screen_is_composited(screen)) {
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
@ -3779,7 +3759,7 @@ nsWindow::Create(nsIWidget* aParent,
// it explicitly now.
gtk_widget_realize(mShell);
/* There are several cases here:
/* There are two cases here:
*
* 1) We're running on Gtk+ without client side decorations.
* Content is rendered to mShell window and we listen