From 7643d1016a6b4776cf671bbc595ec83002d2cc4e Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Fri, 26 Nov 2010 10:49:33 +0100 Subject: Remove gdb_dwarf_index from maemo mkspec maemo6 has gdb7.2 but not gdb-index --- mkspecs/linux-g++-maemo/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf index 23f1f71..56f41c0 100644 --- a/mkspecs/linux-g++-maemo/qmake.conf +++ b/mkspecs/linux-g++-maemo/qmake.conf @@ -5,7 +5,7 @@ MAKEFILE_GENERATOR = UNIX TARGET_PLATFORM = unix TEMPLATE = app -CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +CONFIG += qt warn_on release incremental link_prl CONFIG += nostrip QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -- cgit v0.12 From 32b8c1cd7042aadc02dc3770b25d794d673af44f Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Fri, 26 Nov 2010 09:56:47 +0100 Subject: Added mipmap property to QGLFramebufferObjectFormat. If the mipmap property is set, QGLFramebufferObject will allocate memory for mipmap levels. Reviewed-by: Gunnar --- src/opengl/qglframebufferobject.cpp | 40 ++++++++++++++++++++++++++++++++++--- src/opengl/qglframebufferobject.h | 3 +++ src/opengl/qglframebufferobject_p.h | 13 ++++++++---- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 8915b5e..a7e81b2 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -202,6 +202,35 @@ int QGLFramebufferObjectFormat::samples() const } /*! + \since 4.8 + + Enables or disables mipmapping. Mipmapping is disabled by default. + If mipmapping is enabled, additional memory will be allocated for + the mipmap levels. The mipmap levels can be updated by binding the + texture and calling glGenerateMipmap(). Mipmapping cannot be enabled + for multisampled framebuffer objects. + + \sa mipmap(), texture() +*/ +void QGLFramebufferObjectFormat::setMipmap(bool enabled) +{ + detach(); + d->mipmap = enabled; +} + +/*! + \since 4.8 + + Returns true if mipmapping is enabled. + + \sa setMipmap() +*/ +bool QGLFramebufferObjectFormat::mipmap() const +{ + return d->mipmap; +} + +/*! Sets the attachment configuration of a framebuffer object to \a attachment. \sa attachment() @@ -398,7 +427,8 @@ bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, QGLFramebufferObject::Attachment attachment, - GLenum texture_target, GLenum internal_format, GLint samples) + GLenum texture_target, GLenum internal_format, + GLint samples, bool mipmap) { QGLContext *ctx = const_cast(QGLContext::currentContext()); fbo_guard.setContext(ctx); @@ -426,6 +456,8 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, glBindTexture(target, texture); glTexImage2D(target, 0, internal_format, size.width(), size.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + if (mipmap) + glGenerateMipmap(GL_TEXTURE_2D); #ifndef QT_OPENGL_ES glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -446,6 +478,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, color_buffer = 0; } else { + mipmap = false; GLint maxSamples; glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples); @@ -606,6 +639,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, format.setSamples(int(samples)); format.setAttachment(fbo_attachment); format.setInternalTextureFormat(internal_format); + format.setMipmap(mipmap); } /*! @@ -777,7 +811,7 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, const QGLFramebuff { Q_D(QGLFramebufferObject); d->init(this, size, format.attachment(), format.textureTarget(), format.internalTextureFormat(), - format.samples()); + format.samples(), format.mipmap()); } /*! \overload @@ -791,7 +825,7 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, const QGLFrame { Q_D(QGLFramebufferObject); d->init(this, QSize(width, height), format.attachment(), format.textureTarget(), - format.internalTextureFormat(), format.samples()); + format.internalTextureFormat(), format.samples(), format.mipmap()); } #ifdef Q_MAC_COMPAT_GL_FUNCTIONS diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h index 6ff6645..70d6eb2 100644 --- a/src/opengl/qglframebufferobject.h +++ b/src/opengl/qglframebufferobject.h @@ -148,6 +148,9 @@ public: void setSamples(int samples); int samples() const; + void setMipmap(bool enabled); + bool mipmap() const; + void setAttachment(QGLFramebufferObject::Attachment attachment); QGLFramebufferObject::Attachment attachment() const; diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index 58b4e9e..3738780 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -77,7 +77,8 @@ public: samples(0), attachment(QGLFramebufferObject::NoAttachment), target(GL_TEXTURE_2D), - internal_format(DEFAULT_FORMAT) + internal_format(DEFAULT_FORMAT), + mipmap(false) { } QGLFramebufferObjectFormatPrivate @@ -86,7 +87,8 @@ public: samples(other->samples), attachment(other->attachment), target(other->target), - internal_format(other->internal_format) + internal_format(other->internal_format), + mipmap(other->mipmap) { } bool equals(const QGLFramebufferObjectFormatPrivate *other) @@ -94,7 +96,8 @@ public: return samples == other->samples && attachment == other->attachment && target == other->target && - internal_format == other->internal_format; + internal_format == other->internal_format && + mipmap == other->mipmap; } QAtomicInt ref; @@ -102,6 +105,7 @@ public: QGLFramebufferObject::Attachment attachment; GLenum target; GLenum internal_format; + uint mipmap : 1; }; class QGLFBOGLPaintDevice : public QGLPaintDevice @@ -132,7 +136,8 @@ public: void init(QGLFramebufferObject *q, const QSize& sz, QGLFramebufferObject::Attachment attachment, - GLenum internal_format, GLenum texture_target, GLint samples = 0); + GLenum internal_format, GLenum texture_target, + GLint samples = 0, bool mipmap = false); bool checkFramebufferStatus() const; QGLSharedResourceGuard fbo_guard; GLuint texture; -- cgit v0.12 From 1b218eafc973d14ab7a6db7bfa4ed18b5978c99b Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Fri, 26 Nov 2010 12:10:54 +0100 Subject: Line ending fix. --- .../qmlvisual/webview/flickable/flickweb.qml | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml index 6063226..af09389 100644 --- a/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml +++ b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml @@ -1,35 +1,35 @@ -import QtQuick 1.0 -import QtWebKit 1.0 - -Flickable { - id: flickable - width: 320 - height: 200 - contentWidth: Math.max(flickable.width,webView.width) - contentHeight: Math.max(flickable.height,webView.height) - pressDelay: 100 - - WebView { - id: webView - transformOrigin: Item.TopLeft - smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions - url: "test.html" - preferredWidth: flickable.width - preferredHeight: flickable.height - contentsScale: 1 - onContentsSizeChanged: { - // zoom out - contentsScale = Math.min(1,flickable.width / contentsSize.width) - } - } - - Rectangle { - id: button - width: 50; height: 50; color: "red" - MouseArea { - anchors.fill: parent - onPressed: button.color = "blue" - onReleased: button.color = "green" - } - } -} +import QtQuick 1.0 +import QtWebKit 1.0 + +Flickable { + id: flickable + width: 320 + height: 200 + contentWidth: Math.max(flickable.width,webView.width) + contentHeight: Math.max(flickable.height,webView.height) + pressDelay: 100 + + WebView { + id: webView + transformOrigin: Item.TopLeft + smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions + url: "test.html" + preferredWidth: flickable.width + preferredHeight: flickable.height + contentsScale: 1 + onContentsSizeChanged: { + // zoom out + contentsScale = Math.min(1,flickable.width / contentsSize.width) + } + } + + Rectangle { + id: button + width: 50; height: 50; color: "red" + MouseArea { + anchors.fill: parent + onPressed: button.color = "blue" + onReleased: button.color = "green" + } + } +} -- cgit v0.12 From f9433e9bb5a4eb849860d5eb29c9380e349b6aa9 Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Fri, 26 Nov 2010 13:43:40 +0100 Subject: Revert "Remove gdb_dwarf_index from maemo mkspec" This reverts commit 7643d1016a6b4776cf671bbc595ec83002d2cc4e. --- mkspecs/linux-g++-maemo/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf index 56f41c0..23f1f71 100644 --- a/mkspecs/linux-g++-maemo/qmake.conf +++ b/mkspecs/linux-g++-maemo/qmake.conf @@ -5,7 +5,7 @@ MAKEFILE_GENERATOR = UNIX TARGET_PLATFORM = unix TEMPLATE = app -CONFIG += qt warn_on release incremental link_prl +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index CONFIG += nostrip QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -- cgit v0.12 From 45180cb6e3d92d7bb6ac22515f6cd00206b6fac8 Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Fri, 26 Nov 2010 13:44:43 +0100 Subject: gdb_dwarf_index: change version constraint from 72 to 73 We previously made the false assumption that gdb 7.2 matches sourceware master (which claims to be 7.2, but really is 7.3) --- mkspecs/features/unix/gdb_dwarf_index.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf index e2167a6..c647bae 100644 --- a/mkspecs/features/unix/gdb_dwarf_index.prf +++ b/mkspecs/features/unix/gdb_dwarf_index.prf @@ -1,7 +1,7 @@ !CONFIG(separate_debug_info):CONFIG(debug, debug|release):!staticlib:!static:!contains(TEMPLATE, subdirs):!isEmpty(QMAKE_OBJCOPY) { QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } && \ - test \$\$(gdb --version | sed -e \'s,[^(]*(GDB).\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 71 && \ + test \$\$(gdb --version | sed -e \'s,[^(]*(GDB).\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \ gdb --nx --batch --quiet -ex \'set confirm off\' -ex \'save gdb-index .\' -ex quit \'$(TARGET)\' && \ test -f $(TARGET).gdb-index && \ $$QMAKE_OBJCOPY --add-section \'.gdb_index=$(TARGET).gdb-index\' --set-section-flags \'.gdb_index=readonly\' \'$(TARGET)\' \'$(TARGET)\' && \ -- cgit v0.12