diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/wayland/custom-extension/client/client.pro | 8 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/windowcompositor.cpp | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/examples/wayland/custom-extension/client/client.pro b/examples/wayland/custom-extension/client/client.pro index c2e9a77d7..9ba72bc9c 100644 --- a/examples/wayland/custom-extension/client/client.pro +++ b/examples/wayland/custom-extension/client/client.pro @@ -1,6 +1,3 @@ -PLUGIN_TYPE = platforms -load(qt_plugin) - CONFIG += wayland-scanner CONFIG += link_pkgconfig @@ -22,3 +19,8 @@ SOURCES += main.cpp \ HEADERS += customextension.h +PLUGIN_TYPE = platforms +load(qt_plugin) + +# Installation into a "proper" Qt location is most unexpected for from an example. +CONFIG += install_ok diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp index ecbbc5041..d3e3e1cf0 100644 --- a/examples/wayland/qwindow-compositor/windowcompositor.cpp +++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp @@ -68,16 +68,21 @@ WindowCompositorView::WindowCompositorView() GLuint WindowCompositorView::getTexture(GLenum *target) { QWaylandBufferRef buf = currentBuffer(); - m_texture = buf.textureForPlane(0); + GLuint streamingTexture = buf.textureForPlane(0); + if (streamingTexture) + m_texture = streamingTexture; - if (buf.bufferFormatEgl() == QWaylandBufferRef::BufferFormatEgl_EXTERNAL_OES) + if (!buf.isShm() && buf.bufferFormatEgl() == QWaylandBufferRef::BufferFormatEgl_EXTERNAL_OES) m_textureTarget = GL_TEXTURE_EXTERNAL_OES; if (advance()) { + buf = currentBuffer(); if (!m_texture) glGenTextures(1, &m_texture); glBindTexture(m_textureTarget, m_texture); + if (buf.isShm()) + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); buf.bindToTexture(); } |