summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArmin Berres <armin.berres@basyskom.de>2011-03-16 08:23:57 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2011-03-16 08:23:57 +0100
commitf673f4c8273bcdde76b36cb58cb7b5e46a87f1ac (patch)
tree913e5598a782d0f22cc4752a789d0f43bb3caa65 /src
parent81ce61c9459c85f53486e668b532fe43a4d40ff0 (diff)
downloadqt4-tools-f673f4c8273bcdde76b36cb58cb7b5e46a87f1ac.tar.gz
Make getters for staticContentsSupport and partialUpdateSupport virtual
When QRuntimeGraphicsSystem is asked for its support for static contents of partial updates it should return the value for the currently running wrapped graphicssystem. As the getters have not been virtual so far this could not be implemented. Additionally the setters have been removed as these values are not supposed to be set from the outside. Only the graphicssystems itself knows what it supports. If the default values should be changed the methods should be overwritten. Merge-request: 1136 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qbackingstore_p.h3
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp10
-rw-r--r--src/gui/painting/qgraphicssystem_runtime_p.h3
-rw-r--r--src/gui/painting/qunifiedtoolbarsurface_mac.cpp1
-rw-r--r--src/gui/painting/qwindowsurface.cpp28
-rw-r--r--src/gui/painting/qwindowsurface_p.h6
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp6
-rw-r--r--src/gui/painting/qwindowsurface_raster_p.h1
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp7
-rw-r--r--src/gui/painting/qwindowsurface_s60_p.h2
-rw-r--r--src/gui/painting/qwindowsurface_x11.cpp12
-rw-r--r--src/gui/painting/qwindowsurface_x11_p.h1
-rw-r--r--src/opengl/qwindowsurface_gl.cpp14
-rw-r--r--src/opengl/qwindowsurface_gl_p.h2
-rw-r--r--src/openvg/qwindowsurface_vg.cpp6
-rw-r--r--src/openvg/qwindowsurface_vg_p.h2
-rw-r--r--src/s60installs/bwins/QtGuiu.def2
-rw-r--r--src/s60installs/eabi/QtGuiu.def2
18 files changed, 63 insertions, 45 deletions
diff --git a/src/gui/painting/qbackingstore_p.h b/src/gui/painting/qbackingstore_p.h
index 47387ab4bf..39bf66c8b5 100644
--- a/src/gui/painting/qbackingstore_p.h
+++ b/src/gui/painting/qbackingstore_p.h
@@ -262,7 +262,8 @@ private:
}
inline bool hasStaticContents() const
- { return !staticWidgets.isEmpty() && windowSurface->hasStaticContentsSupport(); }
+ { return !staticWidgets.isEmpty() && windowSurface->hasStaticContentsSupport()
+ && windowSurface->hasPartialUpdateSupport(); }
friend QRegion qt_dirtyRegion(QWidget *);
friend class QWidgetPrivate;
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 5841d40a30..93245ef203 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -319,6 +319,16 @@ QPoint QRuntimeWindowSurface::offset(const QWidget *widget) const
return m_windowSurface->offset(widget);
}
+bool QRuntimeWindowSurface::hasStaticContentsSupport() const
+{
+ return m_windowSurface->hasStaticContentsSupport();
+}
+
+bool QRuntimeWindowSurface::hasPartialUpdateSupport() const
+{
+ return m_windowSurface->hasPartialUpdateSupport();
+}
+
QRuntimeGraphicsSystem::QRuntimeGraphicsSystem()
: m_windowSurfaceDestroyPolicy(DestroyImmediately),
m_graphicsSystem(0)
diff --git a/src/gui/painting/qgraphicssystem_runtime_p.h b/src/gui/painting/qgraphicssystem_runtime_p.h
index 30b4e3e489..998fa982c6 100644
--- a/src/gui/painting/qgraphicssystem_runtime_p.h
+++ b/src/gui/painting/qgraphicssystem_runtime_p.h
@@ -129,6 +129,9 @@ public:
virtual QPoint offset(const QWidget *widget) const;
+ virtual bool hasStaticContentsSupport() const;
+ virtual bool hasPartialUpdateSupport() const;
+
QScopedPointer<QWindowSurface> m_windowSurface;
QScopedPointer<QWindowSurface> m_pendingWindowSurface;
diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
index e7434c7838..c64f572aa4 100644
--- a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
+++ b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
@@ -55,7 +55,6 @@ QUnifiedToolbarSurface::QUnifiedToolbarSurface(QWidget *widget)
{
d_ptr->image = 0;
d_ptr->inSetGeometry = false;
- setStaticContentsSupport(true);
setGeometry(QRect(QPoint(0, 0), QSize(widget->width(), 100))); // FIXME: Fix height.
}
diff --git a/src/gui/painting/qwindowsurface.cpp b/src/gui/painting/qwindowsurface.cpp
index 029b9dc14c..9b71818f88 100644
--- a/src/gui/painting/qwindowsurface.cpp
+++ b/src/gui/painting/qwindowsurface.cpp
@@ -52,8 +52,6 @@ class QWindowSurfacePrivate
public:
QWindowSurfacePrivate(QWidget *w)
: window(w)
- , staticContentsSupport(0)
- , partialUpdateSupport(1)
{
}
@@ -65,8 +63,6 @@ public:
#endif //Q_WS_QPA
QRegion staticContents;
QList<QImage*> bufferImages;
- uint staticContentsSupport : 1;
- uint partialUpdateSupport : 1;
};
/*!
@@ -313,16 +309,7 @@ QPoint QWindowSurface::offset(const QWidget *widget) const
bool QWindowSurface::hasStaticContentsSupport() const
{
- return d_ptr->staticContentsSupport;
-}
-
-void QWindowSurface::setStaticContentsSupport(bool enable)
-{
- if (enable && !d_ptr->partialUpdateSupport) {
- qWarning("QWindowSurface::setStaticContentsSupport: static contents support requires partial update support");
- return;
- }
- d_ptr->staticContentsSupport = enable;
+ return false;
}
void QWindowSurface::setStaticContents(const QRegion &region)
@@ -337,21 +324,12 @@ QRegion QWindowSurface::staticContents() const
bool QWindowSurface::hasStaticContents() const
{
- return d_ptr->staticContentsSupport && !d_ptr->staticContents.isEmpty();
+ return hasStaticContentsSupport() && !d_ptr->staticContents.isEmpty();
}
bool QWindowSurface::hasPartialUpdateSupport() const
{
- return d_ptr->partialUpdateSupport;
-}
-
-void QWindowSurface::setPartialUpdateSupport(bool enable)
-{
- if (!enable && d_ptr->staticContentsSupport) {
- qWarning("QWindowSurface::setPartialUpdateSupport: static contents support requires partial update support");
- return;
- }
- d_ptr->partialUpdateSupport = enable;
+ return true;
}
#ifdef Q_WS_QPA
diff --git a/src/gui/painting/qwindowsurface_p.h b/src/gui/painting/qwindowsurface_p.h
index 62137ef13b..4a2775f099 100644
--- a/src/gui/painting/qwindowsurface_p.h
+++ b/src/gui/painting/qwindowsurface_p.h
@@ -100,16 +100,14 @@ public:
virtual QPoint offset(const QWidget *widget) const;
inline QRect rect(const QWidget *widget) const;
- bool hasStaticContentsSupport() const;
- bool hasPartialUpdateSupport() const;
+ virtual bool hasStaticContentsSupport() const;
+ virtual bool hasPartialUpdateSupport() const;
void setStaticContents(const QRegion &region);
QRegion staticContents() const;
protected:
bool hasStaticContents() const;
- void setStaticContentsSupport(bool enable);
- void setPartialUpdateSupport(bool enable);
private:
QWindowSurfacePrivate *d_ptr;
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index 419518ac53..3a5dcc36ef 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -103,7 +103,6 @@ QRasterWindowSurface::QRasterWindowSurface(QWidget *window, bool setDefaultSurfa
#endif
d_ptr->image = 0;
d_ptr->inSetGeometry = false;
- setStaticContentsSupport(true);
}
@@ -425,6 +424,11 @@ bool QRasterWindowSurface::scroll(const QRegion &area, int dx, int dy)
#endif
}
+bool QRasterWindowSurface::hasStaticContentsSupport() const
+{
+ return true;
+}
+
void QRasterWindowSurface::prepareBuffer(QImage::Format format, QWidget *widget)
{
diff --git a/src/gui/painting/qwindowsurface_raster_p.h b/src/gui/painting/qwindowsurface_raster_p.h
index 903810b936..ad57d48737 100644
--- a/src/gui/painting/qwindowsurface_raster_p.h
+++ b/src/gui/painting/qwindowsurface_raster_p.h
@@ -105,6 +105,7 @@ public:
void beginPaint(const QRegion &rgn);
void setGeometry(const QRect &rect);
bool scroll(const QRegion &area, int dx, int dy);
+ bool hasStaticContentsSupport() const;
private:
#if defined(Q_WS_X11) && !defined(QT_NO_MITSHM)
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 71556d7231..3f2247b966 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -90,8 +90,6 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget)
data->fromSymbianBitmap(bitmap, true);
d_ptr->device = QPixmap(data);
}
-
- setStaticContentsSupport(true);
}
QS60WindowSurface::~QS60WindowSurface()
@@ -231,6 +229,11 @@ void QS60WindowSurface::setGeometry(const QRect& rect)
QWindowSurface::setGeometry(rect);
}
+bool QS60WindowSurface::hasStaticContentsSupport() const
+{
+ return true;
+}
+
CFbsBitmap* QS60WindowSurface::symbianBitmap() const
{
QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
diff --git a/src/gui/painting/qwindowsurface_s60_p.h b/src/gui/painting/qwindowsurface_s60_p.h
index d0d4925cb4..f730c87a9e 100644
--- a/src/gui/painting/qwindowsurface_s60_p.h
+++ b/src/gui/painting/qwindowsurface_s60_p.h
@@ -79,6 +79,8 @@ public:
void setGeometry(const QRect &rect);
+ bool hasStaticContentsSupport() const;
+
CFbsBitmap *symbianBitmap() const;
private:
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index 2324bc2d4f..ab4f53e5a3 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -70,9 +70,6 @@ QX11WindowSurface::QX11WindowSurface(QWidget *widget)
#ifndef QT_NO_XRENDER
d_ptr->translucentBackground = X11->use_xrender
&& widget->x11Info().depth() == 32;
- setStaticContentsSupport(!d_ptr->translucentBackground);
-#else
- setStaticContentsSupport(true);
#endif
}
@@ -253,4 +250,13 @@ QPixmap QX11WindowSurface::grabWidget(const QWidget *widget,
return px;
}
+bool QX11WindowSurface::hasStaticContentsSupport() const
+{
+#ifndef QT_NO_XRENDER
+ return !d_ptr->translucentBackground;
+#else
+ return true;
+#endif
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qwindowsurface_x11_p.h b/src/gui/painting/qwindowsurface_x11_p.h
index 88753ea562..d5179dd1ed 100644
--- a/src/gui/painting/qwindowsurface_x11_p.h
+++ b/src/gui/painting/qwindowsurface_x11_p.h
@@ -80,6 +80,7 @@ public:
bool scroll(const QRegion &area, int dx, int dy);
QPixmap grabWidget(const QWidget *widget,
const QRect& rectangle = QRect()) const;
+ bool hasStaticContentsSupport() const;
private:
QX11WindowSurfacePrivate *d_ptr;
GC gc;
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 21b2f09ddb..ea1f765787 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -299,6 +299,8 @@ struct QGLWindowSurfacePrivate
QList<QImage> buffers;
QGLWindowSurfaceGLPaintDevice glDevice;
QGLWindowSurface* q_ptr;
+
+ bool partialUpdateSupport;
};
QGLFormat QGLWindowSurface::surfaceFormat;
@@ -351,6 +353,7 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window)
d_ptr->q_ptr = this;
d_ptr->geometry_updated = false;
d_ptr->did_paint = false;
+ d_ptr->partialUpdateSupport = false;
}
QGLWindowSurface::~QGLWindowSurface()
@@ -429,11 +432,11 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
if (ctx->d_func()->eglContext->configAttrib(EGL_SWAP_BEHAVIOR) != EGL_BUFFER_PRESERVED &&
! haveNOKSwapRegion)
- setPartialUpdateSupport(false); // Force full-screen updates
+ d_ptr->partialUpdateSupport = false; // Force full-screen updates
else
- setPartialUpdateSupport(true);
+ d_ptr->partialUpdateSupport = true;
#else
- setPartialUpdateSupport(false);
+ d_ptr->partialUpdateSupport = false;
#endif
widgetPrivate->extraData()->glContext = ctx;
@@ -1081,6 +1084,11 @@ QImage *QGLWindowSurface::buffer(const QWidget *widget)
return &d_ptr->buffers.last();
}
+bool QGLWindowSurface::hasPartialUpdateSupport() const
+{
+ return d_ptr->partialUpdateSupport;
+}
+
QT_END_NAMESPACE
diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h
index 67f9f41592..e1689bf6df 100644
--- a/src/opengl/qwindowsurface_gl_p.h
+++ b/src/opengl/qwindowsurface_gl_p.h
@@ -108,6 +108,8 @@ public:
QImage *buffer(const QWidget *widget);
+ bool hasPartialUpdateSupport() const;
+
QGLContext *context() const;
static QGLFormat surfaceFormat;
diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp
index 9ce7f9a210..6f99de480d 100644
--- a/src/openvg/qwindowsurface_vg.cpp
+++ b/src/openvg/qwindowsurface_vg.cpp
@@ -57,7 +57,6 @@ 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
@@ -120,6 +119,11 @@ QPaintEngine *QVGWindowSurface::paintEngine() const
return d_ptr->paintEngine();
}
+bool QVGWindowSurface::hasStaticContentsSupport() const
+{
+ d_ptr->supportsStaticContents();
+}
+
int QVGWindowSurface::metric(PaintDeviceMetric met) const
{
return qt_paint_device_metric(window(), met);
diff --git a/src/openvg/qwindowsurface_vg_p.h b/src/openvg/qwindowsurface_vg_p.h
index 06b16d0137..2d6b4f9503 100644
--- a/src/openvg/qwindowsurface_vg_p.h
+++ b/src/openvg/qwindowsurface_vg_p.h
@@ -78,6 +78,8 @@ public:
QPaintEngine *paintEngine() const;
+ bool hasStaticContentsSupport() const;
+
protected:
int metric(PaintDeviceMetric metric) const;
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index a1f1b50a5f..68cdc9e49e 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -9875,7 +9875,6 @@ EXPORTS
?setState@QPaintEngineEx@@UAEXPAVQPainterState@@@Z @ 9874 NONAME ; void QPaintEngineEx::setState(class QPainterState *)
?setState@TouchPoint@QTouchEvent@@QAEXV?$QFlags@W4TouchPointState@Qt@@@@@Z @ 9875 NONAME ; void QTouchEvent::TouchPoint::setState(class QFlags<enum Qt::TouchPointState>)
?setStaticContents@QWindowSurface@@QAEXABVQRegion@@@Z @ 9876 NONAME ; void QWindowSurface::setStaticContents(class QRegion const &)
- ?setStaticContentsSupport@QWindowSurface@@IAEX_N@Z @ 9877 NONAME ; void QWindowSurface::setStaticContentsSupport(bool)
?setStatus@QPictureIO@@QAEXH@Z @ 9878 NONAME ; void QPictureIO::setStatus(int)
?setStatusBar@QMainWindow@@QAEXPAVQStatusBar@@@Z @ 9879 NONAME ; void QMainWindow::setStatusBar(class QStatusBar *)
?setStatusTip@QAction@@QAEXABVQString@@@Z @ 9880 NONAME ; void QAction::setStatusTip(class QString const &)
@@ -12651,7 +12650,6 @@ EXPORTS
?toImage@QRuntimePixmapData@@UBE?AVQImage@@XZ @ 12650 NONAME ; class QImage QRuntimePixmapData::toImage(void) const
??0QAbstractScrollAreaPrivate@@QAE@XZ @ 12651 NONAME ; QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate(void)
?resizeEvent@QSplitterHandle@@MAEXPAVQResizeEvent@@@Z @ 12652 NONAME ; void QSplitterHandle::resizeEvent(class QResizeEvent *)
- ?setPartialUpdateSupport@QWindowSurface@@IAEX_N@Z @ 12653 NONAME ; void QWindowSurface::setPartialUpdateSupport(bool)
?HandleForegroundEventL@QS60MainAppUi@@MAEXH@Z @ 12654 NONAME ; void QS60MainAppUi::HandleForegroundEventL(int)
?curveThreshold@QStrokerOps@@QBEMXZ @ 12655 NONAME ; float QStrokerOps::curveThreshold(void) const
?createTextureData@QImageTextureGlyphCache@@UAEXHH@Z @ 12656 NONAME ; void QImageTextureGlyphCache::createTextureData(int, int)
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index ef1d67c7ba..8f4b7cce0b 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -3164,7 +3164,6 @@ EXPORTS
_ZN14QWindowSurface10beginPaintERK7QRegion @ 3163 NONAME
_ZN14QWindowSurface11setGeometryERK5QRect @ 3164 NONAME
_ZN14QWindowSurface17setStaticContentsERK7QRegion @ 3165 NONAME
- _ZN14QWindowSurface24setStaticContentsSupportEb @ 3166 NONAME
_ZN14QWindowSurface6bufferEPK7QWidget @ 3167 NONAME
_ZN14QWindowSurface6scrollERK7QRegionii @ 3168 NONAME
_ZN14QWindowSurface8endPaintERK7QRegion @ 3169 NONAME
@@ -11887,7 +11886,6 @@ EXPORTS
_ZN14QGraphicsScale13zScaleChangedEv @ 11886 NONAME
_ZN14QPaintEngineEx19drawPixmapFragmentsEPKN8QPainter14PixmapFragmentEiRK7QPixmap6QFlagsINS0_18PixmapFragmentHintEE @ 11887 NONAME
_ZN14QWidgetPrivate6renderEP12QPaintDeviceRK6QPointRK7QRegion6QFlagsIN7QWidget10RenderFlagEEb @ 11888 NONAME
- _ZN14QWindowSurface23setPartialUpdateSupportEb @ 11889 NONAME
_ZN15QGraphicsObject12widthChangedEv @ 11890 NONAME
_ZN15QGraphicsObject13heightChangedEv @ 11891 NONAME
_ZN15QGraphicsObject15childrenChangedEv @ 11892 NONAME