summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-26 13:35:58 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-26 13:35:58 (GMT)
commit2cda71ec0946f4ce1c983fe518d215c66abd39c4 (patch)
tree2b02a64bc575a05df5eaf7c8205ba3df4f2448b4
parente053119de55be1747f98d15a7871d5bcba2648b6 (diff)
parent45180cb6e3d92d7bb6ac22515f6cd00206b6fac8 (diff)
downloadQt-2cda71ec0946f4ce1c983fe518d215c66abd39c4.zip
Qt-2cda71ec0946f4ce1c983fe518d215c66abd39c4.tar.gz
Qt-2cda71ec0946f4ce1c983fe518d215c66abd39c4.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: gdb_dwarf_index: change version constraint from 72 to 73 Revert "Remove gdb_dwarf_index from maemo mkspec" Line ending fix. Added mipmap property to QGLFramebufferObjectFormat. Remove gdb_dwarf_index from maemo mkspec
-rw-r--r--mkspecs/features/unix/gdb_dwarf_index.prf2
-rw-r--r--src/opengl/qglframebufferobject.cpp40
-rw-r--r--src/opengl/qglframebufferobject.h3
-rw-r--r--src/opengl/qglframebufferobject_p.h13
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml70
5 files changed, 85 insertions, 43 deletions
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)\' && \
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 *>(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;
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"
+ }
+ }
+}