diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-05 16:04:57 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-05 16:04:57 (GMT) |
commit | 3a6bbedcea2b5ef15077a67c58e9e59abe904014 (patch) | |
tree | c2199f9faa005e5082e9fe419fea3b4e85e4c6e7 /src | |
parent | 84b5bbc77045cdc267626ff86f309664283abed4 (diff) | |
parent | 8aa9c7638080e56b124f6542699c45dfbcbba2c0 (diff) | |
download | Qt-3a6bbedcea2b5ef15077a67c58e9e59abe904014.zip Qt-3a6bbedcea2b5ef15077a67c58e9e59abe904014.tar.gz Qt-3a6bbedcea2b5ef15077a67c58e9e59abe904014.tar.bz2 |
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 3 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 13 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl_p.h | 3 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 8 |
4 files changed, 19 insertions, 8 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 7d6ea12..3a9afe1 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1204,7 +1204,8 @@ void QPainterPath::connectPath(const QPainterPath &other) int first = d->elements.size(); d->elements += other.d_func()->elements; - d->elements[first].type = LineToElement; + if (first != 0) + d->elements[first].type = LineToElement; // avoid duplicate points if (first > 0 && QPointF(d->elements[first]) == QPointF(d->elements[first - 1])) { diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 6185ff8..2876906 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -302,6 +302,7 @@ struct QGLWindowSurfacePrivate }; QGLFormat QGLWindowSurface::surfaceFormat; +QGLWindowSurface::SwapMode QGLWindowSurface::swapBehavior = QGLWindowSurface::AutomaticSwap; void QGLWindowSurfaceGLPaintDevice::endPaint() { @@ -576,6 +577,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & const GLenum target = GL_TEXTURE_2D; Q_UNUSED(target); + if (QGLWindowSurface::swapBehavior == QGLWindowSurface::KillSwap) + return; + if (context()) { context()->makeCurrent(); @@ -623,7 +627,14 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & } } #endif - bool doingPartialUpdate = hasPartialUpdateSupport() && br.width() * br.height() < parent->geometry().width() * parent->geometry().height() * 0.2; + bool doingPartialUpdate = false; + if (QGLWindowSurface::swapBehavior == QGLWindowSurface::AutomaticSwap) + doingPartialUpdate = hasPartialUpdateSupport() && br.width() * br.height() < parent->geometry().width() * parent->geometry().height() * 0.2; + else if (QGLWindowSurface::swapBehavior == QGLWindowSurface::AlwaysFullSwap) + doingPartialUpdate = false; + else if (QGLWindowSurface::swapBehavior == QGLWindowSurface::AlwaysPartialSwap) + doingPartialUpdate = hasPartialUpdateSupport(); + QGLContext *ctx = reinterpret_cast<QGLContext *>(parent->d_func()->extraData()->glContext); if (widget != window()) { if (initializeOffscreenTexture(window()->size())) diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h index 22bd5f0..09a6a30 100644 --- a/src/opengl/qwindowsurface_gl_p.h +++ b/src/opengl/qwindowsurface_gl_p.h @@ -112,6 +112,9 @@ public: static QGLFormat surfaceFormat; + enum SwapMode { AutomaticSwap, AlwaysFullSwap, AlwaysPartialSwap, KillSwap }; + static SwapMode swapBehavior; + private slots: void deleted(QObject *object); diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 4a86082..b1a8f5f7 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -75,6 +75,8 @@ QMeeGoGraphicsSystem::~QMeeGoGraphicsSystem() QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const { + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoGraphicsSystem::surfaceWasCreated = true; QWindowSurface *surface = new QGLWindowSurface(widget); return surface; @@ -82,12 +84,6 @@ QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const { - // Long story short: without this it's possible to hit an - // uninitialized paintDevice due to a Qt bug too complex to even - // explain here... not to mention fix without going crazy. - // MDK - QGLShareContextScope ctx(qt_gl_share_widget()->context()); - return new QRasterPixmapData(type); } |