summaryrefslogtreecommitdiffstats
path: root/src/openvg/qwindowsurface_vgegl.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2010-04-13 15:37:06 (GMT)
committerJason Barron <jbarron@trolltech.com>2010-04-14 07:32:22 (GMT)
commit779123b79cc27599f73a61b2f2055a32cc15230a (patch)
tree176d78d8c18308c57f4b8e20d968cf30f2e0fd85 /src/openvg/qwindowsurface_vgegl.cpp
parent67f6618f887b3c524f9da58de8136d474881d29f (diff)
downloadQt-779123b79cc27599f73a61b2f2055a32cc15230a.zip
Qt-779123b79cc27599f73a61b2f2055a32cc15230a.tar.gz
Qt-779123b79cc27599f73a61b2f2055a32cc15230a.tar.bz2
Implement OpenVG buffer scrolling and enable it on Symbian.
Add support for accelerated scrolling in the "direct" window surface implementation. Using vgCopyPixels(), the already rasterized content on the surface can be shifted to a new location such that only a portion of the suqsequent frame needs to be repainted instead of the entire frame. This only works when the "preserved" EGL swap behavior is enabled and the impact on performance is highly dependant on the specific hardware platform in use. Task-number: QT-2972 Reviewed-by: Rhys Weatherley
Diffstat (limited to 'src/openvg/qwindowsurface_vgegl.cpp')
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 46a905f..99b614b 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -758,6 +758,33 @@ void QVGEGLWindowSurfaceDirect::endPaint
}
}
+bool QVGEGLWindowSurfaceDirect::supportsStaticContents() const
+{
+#if defined(QVG_BUFFER_SCROLLING) && !defined(QVG_NO_PRESERVED_SWAP)
+ return true;
+#else
+ return QVGEGLWindowSurfacePrivate::supportsStaticContents();
+#endif
+}
+
+bool QVGEGLWindowSurfaceDirect::scroll(QWidget *widget, const QRegion& area, int dx, int dy)
+{
+#ifdef QVG_BUFFER_SCROLLING
+ QEglContext *context = ensureContext(widget);
+ if (context) {
+ context->makeCurrent(windowSurface);
+ QRect scrollRect = area.boundingRect();
+ int sx = scrollRect.x();
+ int sy = size.height() - scrollRect.y() - scrollRect.height();
+ vgSeti(VG_SCISSORING, VG_FALSE);
+ vgCopyPixels(sx + dx, sy - dy, sx, sy, scrollRect.width(), scrollRect.height());
+ context->lazyDoneCurrent();
+ return true;
+ }
+#endif
+ return false;
+}
+
QT_END_NAMESPACE
#endif