summaryrefslogtreecommitdiffstats
path: root/examples/wayland/qwindow-compositor/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wayland/qwindow-compositor/window.cpp')
-rw-r--r--examples/wayland/qwindow-compositor/window.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp
index 59ef1d56a..fcb5fd474 100644
--- a/examples/wayland/qwindow-compositor/window.cpp
+++ b/examples/wayland/qwindow-compositor/window.cpp
@@ -129,18 +129,17 @@ void Window::paintGL()
m_textureBlitter.bind(currentTarget);
}
QWaylandSurface *surface = view->surface();
- if (surface && surface->hasContent()) {
- QSize s = surface->size();
+ if ((surface && surface->hasContent()) || view->isBufferLocked()) {
+ QSize s = view->size();
if (!s.isEmpty()) {
if (m_mouseView == view && m_grabState == ResizeGrab && m_resizeAnchored)
view->setPosition(getAnchoredPosition(m_resizeAnchorPosition, m_resizeEdge, s));
QPointF pos = view->position() + view->parentPosition();
QRectF surfaceGeometry(pos, s);
- QOpenGLTextureBlitter::Origin surfaceOrigin =
- view->currentBuffer().origin() == QWaylandSurface::OriginTopLeft
- ? QOpenGLTextureBlitter::OriginTopLeft
- : QOpenGLTextureBlitter::OriginBottomLeft;
- QMatrix4x4 targetTransform = QOpenGLTextureBlitter::targetTransform(surfaceGeometry, QRect(QPoint(), size()));
+ auto surfaceOrigin = view->textureOrigin();
+ auto sf = view->animationFactor();
+ QRectF targetRect(surfaceGeometry.topLeft() * sf, surfaceGeometry.size() * sf);
+ QMatrix4x4 targetTransform = QOpenGLTextureBlitter::targetTransform(targetRect, QRect(QPoint(), size()));
m_textureBlitter.blit(texture->textureId(), targetTransform, surfaceOrigin);
}
}
@@ -157,10 +156,8 @@ View *Window::viewAt(const QPointF &point)
Q_FOREACH (View *view, m_compositor->views()) {
if (view == m_dragIconView)
continue;
- QPointF topLeft = view->position();
- QWaylandSurface *surface = view->surface();
- QRectF geo(topLeft, surface->size());
- if (geo.contains(point))
+ QRectF geom(view->position(), view->size());
+ if (geom.contains(point))
ret = view;
}
return ret;