Fix no-opengl build

Change-Id: I577bd5d10e52571c95c9e646327264cf95ac6eb1
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Laszlo Agocs 2014-08-29 17:57:49 +02:00
parent ffceaf6213
commit 6ae01c72e1
6 changed files with 28 additions and 1 deletions

View File

@ -42,6 +42,10 @@
#ifndef QOPENGLWINDOW_H
#define QOPENGLWINDOW_H
#include <QtCore/qglobal.h>
#ifndef QT_NO_OPENGL
#include <QtGui/QPaintDeviceWindow>
#include <QtGui/QOpenGLContext>
#include <QtGui/QImage>
@ -97,4 +101,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
#endif

View File

@ -35,7 +35,7 @@ contains(QT_CONFIG, directfb) {
SUBDIRS += directfb
}
contains(QT_CONFIG, kms) {
contains(QT_CONFIG, kms):contains(QT_CONFIG, opengl) {
SUBDIRS += kms
}

View File

@ -42,6 +42,10 @@
#ifndef QOPENGLWIDGET_H
#define QOPENGLWIDGET_H
#include <QtCore/qglobal.h>
#ifndef QT_NO_OPENGL
#include <QtWidgets/QWidget>
#include <QtGui/QSurfaceFormat>
#include <QtGui/qopengl.h>
@ -97,4 +101,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
#endif // QOPENGLWIDGET_H

View File

@ -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
}
}

View File

@ -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()) {

View File

@ -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