Commit 4a681e3d authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Vlad Zahorodnii
Browse files

[scene] Discard quads when the surface-to-buffer matrix is changed

The surface-to-buffer matrix provides a generic mechanism for mapping
things from the surface-local coordinate space to the buffer coordinate
space. If it changes, we know for sure that the texture coordinates
have to be re-computed.
parent 1d34d292
......@@ -416,9 +416,9 @@ void Scene::addToplevel(Toplevel *c)
connect(monitor, &SubSurfaceMonitor::subSurfaceResized, w, &Window::discardQuads);
connect(monitor, &SubSurfaceMonitor::subSurfaceMapped, w, &Window::discardQuads);
connect(monitor, &SubSurfaceMonitor::subSurfaceUnmapped, w, &Window::discardQuads);
connect(monitor, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged, w, &Window::discardQuads);
connect(c->surface(), &KWaylandServer::SurfaceInterface::scaleChanged, w, &Window::discardQuads);
connect(c->surface(), &KWaylandServer::SurfaceInterface::viewportChanged, w, &Window::discardQuads);
connect(c->surface(), &KWaylandServer::SurfaceInterface::surfaceToBufferMatrixChanged, w, &Window::discardQuads);
}
connect(c, &Toplevel::screenScaleChanged, w, &Window::discardQuads);
......
......@@ -46,6 +46,8 @@ void SubSurfaceMonitor::registerSubSurface(SubSurfaceInterface *subSurface)
this, &SubSurfaceMonitor::subSurfaceMapped);
connect(surface, &SurfaceInterface::unmapped,
this, &SubSurfaceMonitor::subSurfaceUnmapped);
connect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged,
this, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged);
registerSurface(surface);
}
......@@ -64,6 +66,8 @@ void SubSurfaceMonitor::unregisterSubSurface(SubSurfaceInterface *subSurface)
this, &SubSurfaceMonitor::subSurfaceMapped);
disconnect(surface, &SurfaceInterface::unmapped,
this, &SubSurfaceMonitor::subSurfaceUnmapped);
disconnect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged,
this, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged);
unregisterSurface(surface);
}
......
......@@ -70,6 +70,11 @@ Q_SIGNALS:
* This signal is emitted when a sub-surface is unmapped.
*/
void subSurfaceUnmapped();
/**
* This signal is emitted when the mapping between the surface-local coordinate space
* and the buffer coordinate space for a sub-surface has changed.
*/
void subSurfaceSurfaceToBufferMatrixChanged();
private:
void registerSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);
......
Markdown is supported
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