summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-09-01 17:19:35 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-09-01 17:19:35 (GMT)
commit70a24d46f0feca317cca731a302367e8c847c32e (patch)
tree2c94d63e05ced38e5f9279263dd2fe2780ce5b97
parentfb920977b1afd105ae87109d9ee930f5a2fe0b90 (diff)
parent57b3d45dff62e0f23508601caf2560edd3dee33b (diff)
downloadQt-70a24d46f0feca317cca731a302367e8c847c32e.zip
Qt-70a24d46f0feca317cca731a302367e8c847c32e.tar.gz
Qt-70a24d46f0feca317cca731a302367e8c847c32e.tar.bz2
Merge branch '4.6'
-rwxr-xr-xconfigure3
-rw-r--r--examples/qws/dbscreen/dbscreen.cpp2
-rw-r--r--examples/qws/dbscreen/dbscreen.h21
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp36
-rw-r--r--tests/auto/qgl/tst_qgl.cpp55
5 files changed, 92 insertions, 25 deletions
diff --git a/configure b/configure
index 15adf8b..3b0cf5b 100755
--- a/configure
+++ b/configure
@@ -3855,8 +3855,9 @@ elif [ "$Edition" = "OpenSource" ]; then
echo "You have already accepted the terms of the $LicenseType license."
acceptance=yes
else
- test -e "$relpath/LICENSE.GPL3" && \
+ if [ -e "$relpath/LICENSE.GPL3" ]; then
echo "Type '3' to view the GNU General Public License version 3."
+ fi
echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
echo "Type 'yes' to accept this license offer."
echo "Type 'no' to decline this license offer."
diff --git a/examples/qws/dbscreen/dbscreen.cpp b/examples/qws/dbscreen/dbscreen.cpp
index aa33a97..3d3b15b 100644
--- a/examples/qws/dbscreen/dbscreen.cpp
+++ b/examples/qws/dbscreen/dbscreen.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/examples/qws/dbscreen/dbscreen.h b/examples/qws/dbscreen/dbscreen.h
index a3c392e..b177cfc 100644
--- a/examples/qws/dbscreen/dbscreen.h
+++ b/examples/qws/dbscreen/dbscreen.h
@@ -1,11 +1,11 @@
- /****************************************************************************
- **
- ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Nokia Corporation (qt-info@nokia.com)
- **
- ** This file is part of the examples of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
@@ -36,11 +36,8 @@
**
**
** $QT_END_LICENSE$
- **
- ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- **
- ****************************************************************************/
+**
+****************************************************************************/
#ifndef DBSCREEN_H
#define DBSCREEN_H
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 891c027..d48a7b6 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -570,20 +570,34 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
requiredProgram.program->link();
if (!requiredProgram.program->isLinked()) {
+ QLatin1String none("none");
+ QLatin1String br("\n");
QString error;
- qWarning() << "Shader program failed to link,"
+ error = QLatin1String("Shader program failed to link,")
#if defined(QT_DEBUG)
- << '\n'
- << " Shaders Used:" << '\n'
- << " mainVertexShader = " << requiredProgram.mainVertexShader->objectName() << '\n'
- << " positionVertexShader = " << requiredProgram.positionVertexShader->objectName() << '\n'
- << " mainFragShader = " << requiredProgram.mainFragShader->objectName() << '\n'
- << " srcPixelFragShader = " << requiredProgram.srcPixelFragShader->objectName() << '\n'
- << " maskFragShader = " << requiredProgram.maskFragShader->objectName() << '\n'
- << " compositionFragShader = "<< requiredProgram.compositionFragShader->objectName() << '\n'
+ + br
+ + QLatin1String(" Shaders Used:\n")
+ + QLatin1String(" mainVertexShader = ")
+ + (requiredProgram.mainVertexShader ?
+ requiredProgram.mainVertexShader->objectName() : none) + br
+ + QLatin1String(" positionVertexShader = ")
+ + (requiredProgram.positionVertexShader ?
+ requiredProgram.positionVertexShader->objectName() : none) + br
+ + QLatin1String(" mainFragShader = ")
+ + (requiredProgram.mainFragShader ?
+ requiredProgram.mainFragShader->objectName() : none) + br
+ + QLatin1String(" srcPixelFragShader = ")
+ + (requiredProgram.srcPixelFragShader ?
+ requiredProgram.srcPixelFragShader->objectName() : none) + br
+ + QLatin1String(" maskFragShader = ")
+ + (requiredProgram.maskFragShader ?
+ requiredProgram.maskFragShader->objectName() : none) + br
+ + QLatin1String(" compositionFragShader = ")
+ + (requiredProgram.compositionFragShader ?
+ requiredProgram.compositionFragShader->objectName() : none) + br
#endif
- << " Error Log:" << '\n'
- << " " << requiredProgram.program->log();
+ + QLatin1String(" Error Log:\n")
+ + QLatin1String(" ") + requiredProgram.program->log();
qWarning() << error;
delete requiredProgram.program;
} else {
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 1629542..f979174 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -73,6 +73,7 @@ private slots:
void partialGLWidgetUpdates();
void glWidgetRendering();
void glFBORendering();
+ void glFBOUseInGLWidget();
void glPBufferRendering();
void glWidgetReparent();
void colormap();
@@ -769,6 +770,60 @@ void tst_QGL::glFBORendering()
QCOMPARE(fb.pixel(192, 64), QColor(Qt::green).rgb());
}
+class FBOUseInGLWidget : public QGLWidget
+{
+public:
+ bool widgetPainterBeginOk;
+ bool fboPainterBeginOk;
+ QImage fboImage;
+protected:
+ void paintEvent(QPaintEvent*)
+ {
+ QPainter widgetPainter;
+ widgetPainterBeginOk = widgetPainter.begin(this);
+ QGLFramebufferObjectFormat fboFormat(0, QGLFramebufferObject::CombinedDepthStencil);
+ QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat);
+
+ QPainter fboPainter;
+ fboPainterBeginOk = fboPainter.begin(fbo);
+ fboPainter.fillRect(0, 0, 128, 128, Qt::red);
+ fboPainter.end();
+ fboImage = fbo->toImage();
+
+ widgetPainter.fillRect(rect(), Qt::blue);
+
+ delete fbo;
+ }
+
+};
+
+void tst_QGL::glFBOUseInGLWidget()
+{
+ if (!QGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle);
+
+ FBOUseInGLWidget w;
+ w.resize(128, 128);
+ w.show();
+
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&w);
+#endif
+ QTest::qWait(200);
+
+ QVERIFY(w.widgetPainterBeginOk);
+ QVERIFY(w.fboPainterBeginOk);
+
+ QImage widgetFB = w.grabFrameBuffer(false);
+ QImage widgetReference(widgetFB.size(), widgetFB.format());
+ widgetReference.fill(0xff0000ff);
+ QCOMPARE(widgetFB, widgetReference);
+
+ QImage fboReference(w.fboImage.size(), w.fboImage.format());
+ fboReference.fill(0xffff0000);
+ QCOMPARE(w.fboImage, fboReference);
+}
+
void tst_QGL::glWidgetReparent()
{
// Try it as a top-level first: