diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2016-05-26 14:34:16 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2016-05-26 14:37:43 +0200 |
commit | e56322f10613e0838ecec7fa74e676f625dbf884 (patch) | |
tree | 872396be9bc8e5d11cd68c8482b6b5bf744d86cf /examples | |
parent | 20692ad15b8ac0c24b12d30609f061a740c87f23 (diff) | |
parent | 2a593a98fd2d58f942e9171f3d5b0c851fefe4aa (diff) |
Merge remote-tracking branch 'qt/5.7.0' into 5.7
Change-Id: I6236699846c922a79a1bd420a161392fd6572001
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 d0b3e4c16..1c17b31f7 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(); } |