summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-19 15:38:54 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-19 15:38:54 (GMT)
commit2c86259f7422531c234faac1d1abbde603228195 (patch)
tree7f6efe2d32543d7875461b5e0ff40a05be854517
parentb997254ba37e3ccfaa26be7021e2b172bfd82691 (diff)
parente318e3985247e0be91ae4f94afef7a39ea9928c6 (diff)
downloadQt-2c86259f7422531c234faac1d1abbde603228195.zip
Qt-2c86259f7422531c234faac1d1abbde603228195.tar.gz
Qt-2c86259f7422531c234faac1d1abbde603228195.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make the qWarnings in the animation API more useful. Fixed y-inverted pixmaps on N900. Fix X11/EGL builds using OpenGL ES 1.1 Fix Typo
-rw-r--r--doc/src/snippets/qstring/main.cpp2
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp17
-rw-r--r--src/opengl/qpixmapdata_gl.cpp12
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp51
4 files changed, 66 insertions, 16 deletions
diff --git a/doc/src/snippets/qstring/main.cpp b/doc/src/snippets/qstring/main.cpp
index 629586e..3be504c 100644
--- a/doc/src/snippets/qstring/main.cpp
+++ b/doc/src/snippets/qstring/main.cpp
@@ -802,7 +802,7 @@ void Widget::toLowerFunction()
{
//! [75]
QString str = "Qt by NOKIA";
- str = str.toLower(); // str == "qy by nokia"
+ str = str.toLower(); // str == "qt by nokia"
//! [75]
}
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index eec5b30..cfd7cc2 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -256,7 +256,8 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
Q_D(QPropertyAnimation);
if (!d->target && oldState == Stopped) {
- qWarning("QPropertyAnimation::updateState: Changing state of an animation without target");
+ qWarning("QPropertyAnimation::updateState (%s): Changing state of an animation without target",
+ d->propertyName.constData());
return;
}
@@ -279,10 +280,16 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
if (oldState == Stopped) {
d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData()));
//let's check if we have a start value and an end value
- if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid()))
- qWarning("QPropertyAnimation::updateState: starting an animation without start value");
- if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid()))
- qWarning("QPropertyAnimation::updateState: starting an animation without end value");
+ if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value",
+ d->propertyName.constData(), d->target.data()->metaObject()->className(),
+ qPrintable(d->target.data()->objectName()));
+ }
+ if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value",
+ d->propertyName.constData(), d->target.data()->metaObject()->className(),
+ qPrintable(d->target.data()->objectName()));
+ }
}
} else if (hash.value(key) == this) {
hash.remove(key);
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 1bfb6e3..6d47687 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -252,6 +252,10 @@ QGLPixmapData::QGLPixmapData(PixelType type)
{
setSerialNumber(++qt_gl_pixmap_serial);
m_glDevice.setPixmapData(this);
+
+ // Set InteralBindOptions minus the memory managed, since this
+ // QGLTexture is not managed as part of the internal texture cache
+ m_texture.options = QGLContext::PremultipliedAlphaBindOption;
}
QGLPixmapData::~QGLPixmapData()
@@ -340,18 +344,18 @@ void QGLPixmapData::ensureCreated() const
}
if (!m_source.isNull()) {
+ glBindTexture(target, m_texture.id);
if (external_format == GL_RGB) {
const QImage tx = m_source.convertToFormat(QImage::Format_RGB888);
-
- glBindTexture(target, m_texture.id);
glTexSubImage2D(target, 0, 0, 0, w, h, external_format,
GL_UNSIGNED_BYTE, tx.bits());
} else {
const QImage tx = ctx->d_func()->convertToGLFormat(m_source, true, external_format);
-
- glBindTexture(target, m_texture.id);
glTexSubImage2D(target, 0, 0, 0, w, h, external_format,
GL_UNSIGNED_BYTE, tx.bits());
+ // convertToGLFormat will flip the Y axis, so it needs to
+ // be drawn upside down
+ m_texture.options |= QGLContext::InvertedYBindOption;
}
if (useFramebufferObjects())
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index a5e0239..55aa1d0 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -39,10 +39,19 @@
**
****************************************************************************/
+#include <QDebug>
+
#include <private/qgl_p.h>
#include <private/qegl_p.h>
#include <private/qeglproperties_p.h>
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
#include <private/qpaintengineex_opengl2_p.h>
+#endif
+
+#ifndef QT_OPENGL_ES_2
+#include <private/qpaintengine_opengl_p.h>
+#endif
#include "qpixmapdata_x11gl_p.h"
@@ -187,7 +196,14 @@ QX11GLPixmapData::~QX11GLPixmapData()
{
}
-static QGL2PaintEngineEx* qt_gl2_engine_for_pixmaps = 0;
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_pixmap_2_engine)
+#endif
+
+#ifndef QT_OPENGL_ES_2
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_pixmap_engine)
+#endif
+
QPaintEngine* QX11GLPixmapData::paintEngine() const
{
@@ -202,18 +218,41 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const
: qPixmapRGBSharedEglContext);
}
- if (!qt_gl2_engine_for_pixmaps)
- qt_gl2_engine_for_pixmaps = new QGL2PaintEngineEx();
+ QPaintEngine* engine;
+
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ engine = qt_gl_pixmap_engine();
+#elif defined(QT_OPENGL_ES_2)
+ engine = qt_gl_pixmap_2_engine();
+#else
+ if (qt_gl_preferGL2Engine())
+ engine = qt_gl_pixmap_2_engine();
+ else
+ engine = qt_gl_pixmap_engine();
+#endif
+
+
// Support multiple painters on multiple pixmaps simultaniously
- if (qt_gl2_engine_for_pixmaps->isActive()) {
+ if (engine->isActive()) {
qWarning("Pixmap paint engine already active");
- QPaintEngine* engine = new QGL2PaintEngineEx();
+
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ engine = new QOpenGLPaintEngine;
+#elif defined(QT_OPENGL_ES_2)
+ engine = new QGL2PaintEngineEx;
+#else
+ if (qt_gl_preferGL2Engine())
+ engine = new QGL2PaintEngineEx;
+ else
+ engine = new QOpenGLPaintEngine;
+#endif
+
engine->setAutoDestruct(true);
return engine;
}
- return qt_gl2_engine_for_pixmaps;
+ return engine;
}
void QX11GLPixmapData::beginPaint()