summaryrefslogtreecommitdiffstats
path: root/examples/wayland/qwindow-compositor
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2016-05-26 14:34:16 +0200
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2016-05-26 14:37:43 +0200
commite56322f10613e0838ecec7fa74e676f625dbf884 (patch)
tree872396be9bc8e5d11cd68c8482b6b5bf744d86cf /examples/wayland/qwindow-compositor
parent20692ad15b8ac0c24b12d30609f061a740c87f23 (diff)
parent2a593a98fd2d58f942e9171f3d5b0c851fefe4aa (diff)
Merge remote-tracking branch 'qt/5.7.0' into 5.7
Diffstat (limited to 'examples/wayland/qwindow-compositor')
-rw-r--r--examples/wayland/qwindow-compositor/windowcompositor.cpp9
1 files changed, 7 insertions, 2 deletions
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();
}