From 6ae01c72e1634d41e4775e6cec0089c8d49da29c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 29 Aug 2014 17:57:49 +0200 Subject: Fix no-opengl build Change-Id: I577bd5d10e52571c95c9e646327264cf95ac6eb1 Reviewed-by: Andrew Knight Reviewed-by: Friedemann Kleint --- src/gui/kernel/qopenglwindow.h | 6 ++++++ src/plugins/platforms/platforms.pro | 2 +- src/widgets/kernel/qopenglwidget.h | 6 ++++++ src/widgets/kernel/qwidget.cpp | 8 ++++++++ src/widgets/kernel/qwidgetbackingstore.cpp | 5 +++++ src/widgets/widgets/qabstractscrollarea.cpp | 2 ++ 6 files changed, 28 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qopenglwindow.h b/src/gui/kernel/qopenglwindow.h index 294bd90116..e30de3b6ac 100644 --- a/src/gui/kernel/qopenglwindow.h +++ b/src/gui/kernel/qopenglwindow.h @@ -42,6 +42,10 @@ #ifndef QOPENGLWINDOW_H #define QOPENGLWINDOW_H +#include + +#ifndef QT_NO_OPENGL + #include #include #include @@ -97,4 +101,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_OPENGL + #endif diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 584efa1665..69f6f308b5 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -35,7 +35,7 @@ contains(QT_CONFIG, directfb) { SUBDIRS += directfb } -contains(QT_CONFIG, kms) { +contains(QT_CONFIG, kms):contains(QT_CONFIG, opengl) { SUBDIRS += kms } diff --git a/src/widgets/kernel/qopenglwidget.h b/src/widgets/kernel/qopenglwidget.h index 28d802e1f4..f706ea7567 100644 --- a/src/widgets/kernel/qopenglwidget.h +++ b/src/widgets/kernel/qopenglwidget.h @@ -42,6 +42,10 @@ #ifndef QOPENGLWIDGET_H #define QOPENGLWIDGET_H +#include + +#ifndef QT_NO_OPENGL + #include #include #include @@ -97,4 +101,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_OPENGL + #endif // QOPENGLWIDGET_H diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 34adea866e..21278a0ba9 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5486,22 +5486,30 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP //paint the background if ((asRoot || q->autoFillBackground() || onScreen || q->testAttribute(Qt::WA_StyledBackground)) && !q->testAttribute(Qt::WA_OpaquePaintEvent) && !q->testAttribute(Qt::WA_NoSystemBackground)) { +#ifndef QT_NO_OPENGL beginBackingStorePainting(); +#endif QPainter p(q); paintBackground(&p, toBePainted, (asRoot || onScreen) ? flags | DrawAsRoot : 0); +#ifndef QT_NO_OPENGL endBackingStorePainting(); +#endif } if (!sharedPainter) setSystemClip(pdev, toBePainted.translated(offset)); if (!onScreen && !asRoot && !isOpaque && q->testAttribute(Qt::WA_TintedBackground)) { +#ifndef QT_NO_OPENGL beginBackingStorePainting(); +#endif QPainter p(q); QColor tint = q->palette().window().color(); tint.setAlphaF(qreal(.6)); p.fillRect(toBePainted.boundingRect(), tint); +#ifndef QT_NO_OPENGL endBackingStorePainting(); +#endif } } diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 2a968939e4..103e244593 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -1158,6 +1158,7 @@ void QWidgetBackingStore::doSync() return; } +#ifndef QT_NO_OPENGL // There is something other dirty than the renderToTexture widgets. // Now it is time to include the renderToTexture ones among the others. if (widgetTextures && widgetTextures->count()) { @@ -1167,6 +1168,8 @@ void QWidgetBackingStore::doSync() toClean += rect; } } +#endif + // The dirtyRenderToTextureWidgets list is useless here, so just reset. As // unintuitive as it is, we need to send paint events to renderToTexture // widgets always when something (any widget) needs to be updated, even if @@ -1249,8 +1252,10 @@ void QWidgetBackingStore::flush(QWidget *widget) QWidget *target = widget ? widget : tlw; qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset, widgetTextures, this); dirtyOnScreen = QRegion(); +#ifndef QT_NO_OPENGL if (widgetTextures && widgetTextures->count()) return; +#endif } if (!dirtyOnScreenWidgets || dirtyOnScreenWidgets->isEmpty()) { diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 1b48441993..0e78c1493b 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -1191,10 +1191,12 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e) case QEvent::DragMove: case QEvent::DragLeave: #endif +#ifndef QT_NO_OPENGL // QOpenGLWidget needs special support because it has to know // its size has changed, so that it can resize its fbo. if (e->type() == QEvent::Resize) QWidgetPrivate::get(viewport())->resizeViewportFramebuffer(); +#endif return QFrame::event(e); case QEvent::LayoutRequest: #ifndef QT_NO_GESTURES -- cgit v1.2.3