Commit 8befcff5 by Corentin Wallez

WindowSurfaceGLX: set the border pixel attribute

This is so we can use a different visual depth than our parent window so that we can create a subwindow whichever the parent's visual. BUG=angleproject:892 Change-Id: I9bab676761b1f80fad1599adb8e97a3ec710f67f Reviewed-on: https://chromium-review.googlesource.com/271425Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent d176dbd7
...@@ -61,9 +61,12 @@ egl::Error WindowSurfaceGLX::initialize() ...@@ -61,9 +61,12 @@ egl::Error WindowSurfaceGLX::initialize()
// The depth, colormap and visual must match otherwise we get a X error // The depth, colormap and visual must match otherwise we get a X error
// so we specify the colormap attribute. Also we do not want the window // so we specify the colormap attribute. Also we do not want the window
// to be taken into account for input so we specify the event and // to be taken into account for input so we specify the event and
// do-not-propagate masks to 0 (the defaults). // do-not-propagate masks to 0 (the defaults). Finally we specify the
// border pixel attribute so that we can use a different visual depth
// than our parent (seems like X uses that as a condition to render
// the subwindow in a different buffer)
XSetWindowAttributes attributes; XSetWindowAttributes attributes;
unsigned long attributeMask = CWColormap; unsigned long attributeMask = CWColormap | CWBorderPixel;
Colormap colormap = XCreateColormap(mDisplay, mParent, visual, AllocNone); Colormap colormap = XCreateColormap(mDisplay, mParent, visual, AllocNone);
if(!colormap) if(!colormap)
...@@ -72,6 +75,7 @@ egl::Error WindowSurfaceGLX::initialize() ...@@ -72,6 +75,7 @@ egl::Error WindowSurfaceGLX::initialize()
return egl::Error(EGL_BAD_NATIVE_WINDOW, "Failed to create the Colormap for the child window."); return egl::Error(EGL_BAD_NATIVE_WINDOW, "Failed to create the Colormap for the child window.");
} }
attributes.colormap = colormap; attributes.colormap = colormap;
attributes.background_pixel = 0;
//TODO(cwallez) set up our own error handler to see if the call failed //TODO(cwallez) set up our own error handler to see if the call failed
mWindow = XCreateWindow(mDisplay, mParent, 0, 0, parentAttribs.width, parentAttribs.height, mWindow = XCreateWindow(mDisplay, mParent, 0, 0, parentAttribs.width, parentAttribs.height,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment