[vlc-devel] [vlc-commits] Implement a first try for the WindowLess on Linux
Rémi Denis-Courmont
remi at remlab.net
Thu Dec 13 15:40:42 CET 2012
This patch cannot be left like this without follow-up. It's a massive
performance regression, and introduces or reintroduces bugs.
On Thu, 13 Dec 2012 15:19:23 +0100 (CET), git at videolan.org (Cheng Sun)
wrote:
> +bool VlcWindowlessLinux::handle_event(void *event)
> +{
> +#warning FIXME: this is waaayyy too slow!
> + XEvent *xevent = static_cast<XEvent *>(event);
> + switch (xevent->type) {
> + case GraphicsExpose:
> + XGraphicsExposeEvent *xgeevent =
> reinterpret_cast<XGraphicsExposeEvent *>(xevent);
> + Display *display = xgeevent->display;
> +
> + int screen = XDefaultScreen(display);
This is wrong. The screen should correspond to the drawable, as specified
in XPutImage() below.
> + XVisualInfo visual;
> + XMatchVisualInfo(display, screen, 24, TrueColor, &visual);
This function call can fail.
> + XImage *image = XCreateImage(display, visual.visual, 24,
ZPixmap,
> + 0, &m_frame_buf[0],
> + m_media_width, m_media_height,
> + DEF_PIXEL_BYTES*8,
> + m_media_width * DEF_PIXEL_BYTES);
> +
> + const NPRect &clip = npwindow.clipRect;
> + XPutImage(display, xgeevent->drawable,
> + XDefaultGCOfScreen(XScreenOfDisplay(display,
screen)), image,
> + clip.left - npwindow.x, clip.top - npwindow.y,
> + clip.left, clip.top,
> + clip.right - clip.left, clip.bottom - clip.top);
XShm functions would be vastly more efficient when rendering locally.
And then after Laurent and I have spent so much efforts moving away from
Xlib, I cannot accept reverting without justifications. Unlike with VAAPI,
GLX, VDPAU or Qt4, I fail to see any reason why XCB cannot be used here.
--
Rémi Denis-Courmont
Sent from my collocated server
More information about the vlc-devel
mailing list