summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformsurface.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-01 14:29:15 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-01 20:12:15 +0200
commit90c54b02f83961b1c66f10fe57bcfcf4523ebba1 (patch)
treefe38a30c28765cab00c270ce735c130911d325e2 /src/gui/kernel/qplatformsurface.cpp
parent8c52f8cbf54634e880b96e4e9b0e54348de60440 (diff)
Fix scrolling of QRasterBackingStore when operating on QRasterGLSurface
We were to strict in what surface type we allowed scrolling for. The RasterGLSurface type is an odd one, used by widgets to compose GL and raster content, which means we still have a raster backingstore we can scroll. It's just the flush that's different. Pick-to: 6.2 Change-Id: Ia229c21c00ad38df9e87f4fc78e341e030ef228d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformsurface.cpp')
-rw-r--r--src/gui/kernel/qplatformsurface.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformsurface.cpp b/src/gui/kernel/qplatformsurface.cpp
index fdb2cf567d8..772207a7a91 100644
--- a/src/gui/kernel/qplatformsurface.cpp
+++ b/src/gui/kernel/qplatformsurface.cpp
@@ -68,6 +68,17 @@ QPlatformSurface::QPlatformSurface(QSurface *surface) : m_surface(surface)
{
}
+bool QPlatformSurface::isRasterSurface(QSurface *surface)
+{
+ switch (surface->surfaceType()) {
+ case QSurface::RasterSurface:
+ case QSurface::RasterGLSurface:
+ return true;
+ default:
+ return false;
+ };
+}
+
#ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QPlatformSurface *surface)
{