summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-04-16 10:20:46 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-04-16 10:20:46 (GMT)
commitd626cfeae84a52f3f752be6dd5ed7df11e4b3be1 (patch)
treefe9732af8c2c49c20bc450cdb53087e185ff8633 /src/openvg
parent140a96d0b860b045c18d53c1ac96e77b3893d31c (diff)
parentfb44c5b866da71fcbe992f6d02fb18ab2470ac53 (diff)
downloadQt-d626cfeae84a52f3f752be6dd5ed7df11e4b3be1.zip
Qt-d626cfeae84a52f3f752be6dd5ed7df11e4b3be1.tar.gz
Qt-d626cfeae84a52f3f752be6dd5ed7df11e4b3be1.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtNetworku.def src/s60installs/eabi/QtGuiu.def tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/openvg.pro2
-rw-r--r--src/openvg/qpaintengine_vg.cpp8
-rw-r--r--src/openvg/qpixmapdata_vg.cpp4
-rw-r--r--src/openvg/qwindowsurface_vg.cpp5
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp27
-rw-r--r--src/openvg/qwindowsurface_vgegl_p.h4
6 files changed, 42 insertions, 8 deletions
diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro
index 3790492..883f0f3 100644
--- a/src/openvg/openvg.pro
+++ b/src/openvg/openvg.pro
@@ -33,7 +33,7 @@ contains(QT_CONFIG, egl) {
qwindowsurface_vgegl.cpp
}
-symbian: DEFINES += QVG_RECREATE_ON_SIZE_CHANGE
+symbian: DEFINES += QVG_RECREATE_ON_SIZE_CHANGE QVG_BUFFER_SCROLLING
include(../qbase.pri)
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index d1e899a..5ae69cd 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -75,8 +75,8 @@ QT_BEGIN_NAMESPACE
#if !defined(QVG_NO_DRAW_GLYPHS)
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_DECL_IMPORT extern int qt_defaultDpiX();
+Q_DECL_IMPORT extern int qt_defaultDpiY();
class QVGPaintEnginePrivate;
@@ -496,7 +496,7 @@ void QVGPaintEnginePrivate::setTransform
vgLoadMatrix(mat);
}
-extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
+Q_DECL_IMPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
{
@@ -974,7 +974,7 @@ VGPath QVGPaintEnginePrivate::roundedRectPath(const QRectF &rect, qreal xRadius,
return vgpath;
}
-extern QImage qt_imageForBrush(int style, bool invert);
+Q_DECL_IMPORT extern QImage qt_imageForBrush(int style, bool invert);
static QImage colorizeBitmap(const QImage &image, const QColor &color)
{
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 6258e0c..a4afc95 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -347,8 +347,8 @@ void QVGPixmapData::reclaimImages()
destroyImages();
}
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_DECL_IMPORT extern int qt_defaultDpiX();
+Q_DECL_IMPORT extern int qt_defaultDpiY();
int QVGPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
{
diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp
index 07d9209..55dcef3 100644
--- a/src/openvg/qwindowsurface_vg.cpp
+++ b/src/openvg/qwindowsurface_vg.cpp
@@ -57,6 +57,7 @@ QVGWindowSurface::QVGWindowSurface(QWidget *window)
{
// Create the default type of EGL window surface for windows.
d_ptr = new QVGEGLWindowSurfaceDirect(this);
+ setStaticContentsSupport(d_ptr->supportsStaticContents());
}
QVGWindowSurface::QVGWindowSurface
@@ -89,7 +90,9 @@ void QVGWindowSurface::setGeometry(const QRect &rect)
bool QVGWindowSurface::scroll(const QRegion &area, int dx, int dy)
{
- return QWindowSurface::scroll(area, dx, dy);
+ if (!d_ptr->scroll(window(), area, dx, dy))
+ return QWindowSurface::scroll(area, dx, dy);
+ return true;
}
void QVGWindowSurface::beginPaint(const QRegion &region)
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 13ae807..92c4371 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
diff --git a/src/openvg/qwindowsurface_vgegl_p.h b/src/openvg/qwindowsurface_vgegl_p.h
index f6adbf3..fe62ed3 100644
--- a/src/openvg/qwindowsurface_vgegl_p.h
+++ b/src/openvg/qwindowsurface_vgegl_p.h
@@ -77,6 +77,8 @@ public:
(QWidget *widget, const QRegion& region, QImage *image = 0) = 0;
virtual VGImage surfaceImage() const;
virtual QSize surfaceSize() const = 0;
+ virtual bool supportsStaticContents() const { return false; }
+ virtual bool scroll(QWidget *, const QRegion&, int, int) { return false; }
private:
QVGPaintEngine *engine;
@@ -128,6 +130,8 @@ public:
void beginPaint(QWidget *widget);
void endPaint(QWidget *widget, const QRegion& region, QImage *image);
QSize surfaceSize() const { return size; }
+ bool supportsStaticContents() const;
+ bool scroll(QWidget *widget, const QRegion& area, int dx, int dy);
protected:
QEglContext *context;