Commit 128570ed authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Restore correct type check for wl_drm client buffers

With the EGLStreams support gone, we can restore the correct type check
for wl_drm client buffers. The spec suggests to query the
EGL_TEXTURE_FORMAT attribute to determine whether the specified wl_buffer
is a wl_drm buffer.
parent 26233a8d
......@@ -36,12 +36,7 @@ DrmClientBuffer::DrmClientBuffer(wl_resource *resource, DrmClientBufferIntegrati
Q_D(DrmClientBuffer);
EGLDisplay eglDisplay = integration->display()->eglDisplay();
if (!eglQueryWaylandBufferWL(eglDisplay, resource, EGL_TEXTURE_FORMAT, &d->textureFormat)) {
// The proprietary Nvidia driver doesn't support querying the EGL_TEXTURE_FORMAT.
// We must assume that the buffer has an alpha channel for transparency to work.
d->textureFormat = EGL_TEXTURE_RGBA;
}
eglQueryWaylandBufferWL(eglDisplay, resource, EGL_TEXTURE_FORMAT, &d->textureFormat);
eglQueryWaylandBufferWL(eglDisplay, resource, EGL_WIDTH, &d->width);
eglQueryWaylandBufferWL(eglDisplay, resource, EGL_HEIGHT, &d->height);
......@@ -89,8 +84,8 @@ ClientBuffer *DrmClientBufferIntegration::createBuffer(::wl_resource *resource)
resolved = true;
}
EGLint height;
if (eglQueryWaylandBufferWL(eglDisplay, resource, EGL_HEIGHT, &height)) {
EGLint format;
if (eglQueryWaylandBufferWL(eglDisplay, resource, EGL_TEXTURE_FORMAT, &format)) {
return new DrmClientBuffer(resource, this);
}
return nullptr;
......
Supports Markdown
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