summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-04 11:20:52 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-09-04 11:30:08 (GMT)
commit9d85dcf10d580a45c261e3e1a8d8df7d41cb9437 (patch)
treee76fdbf00784369987304df12a03bf38801566fc /src
parent74cb4b7ca71e64d08fab7d4e00a15e29fa339f5b (diff)
downloadQt-9d85dcf10d580a45c261e3e1a8d8df7d41cb9437.zip
Qt-9d85dcf10d580a45c261e3e1a8d8df7d41cb9437.tar.gz
Qt-9d85dcf10d580a45c261e3e1a8d8df7d41cb9437.tar.bz2
Slightly improved QGLFramebufferObjectFormat API.
Renaming setInternalFormat() to setInternalTextureFormat() (and similarly for the accessor) makes the API a bit more explicit. Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglframebufferobject.cpp29
-rw-r--r--src/opengl/qglframebufferobject.h6
-rw-r--r--src/opengl/qglpixmapfilter.cpp2
-rw-r--r--src/opengl/qpixmapdata_gl.cpp4
-rw-r--r--src/opengl/qwindowsurface_gl.cpp2
5 files changed, 22 insertions, 21 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index a03e627..8e97edf 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -97,7 +97,7 @@ public:
\i \link setSamples() Number of samples per pixels.\endlink
\i \link setAttachment() Depth and/or stencil attachments.\endlink
\i \link setTextureTarget() Texture target.\endlink
- \i \link setInternalFormat() Internal format.\endlink
+ \i \link setInternalTextureFormat() Internal texture format.\endlink
\endlist
Note that the desired attachments or number of samples per pixels might not
@@ -115,7 +115,7 @@ public:
By default the format specifies a non-multisample framebuffer object with no
attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
- \sa samples(), attachment(), target(), internalFormat()
+ \sa samples(), attachment(), target(), internalTextureFormat()
*/
#ifndef QT_OPENGL_ES
@@ -234,23 +234,24 @@ GLenum QGLFramebufferObjectFormat::textureTarget() const
}
/*!
- Sets the internal format of a framebuffer object's texture or multisample
- framebuffer object's color buffer to \a internalFormat.
+ Sets the internal format of a framebuffer object's texture or
+ multisample framebuffer object's color buffer to
+ \a internalTextureFormat.
- \sa internalFormat()
+ \sa internalTextureFormat()
*/
-void QGLFramebufferObjectFormat::setInternalFormat(GLenum internalFormat)
+void QGLFramebufferObjectFormat::setInternalTextureFormat(GLenum internalTextureFormat)
{
- d->internal_format = internalFormat;
+ d->internal_format = internalTextureFormat;
}
/*!
Returns the internal format of a framebuffer object's texture or
multisample framebuffer object's color buffer.
- \sa setInternalFormat()
+ \sa setInternalTextureFormat()
*/
-GLenum QGLFramebufferObjectFormat::internalFormat() const
+GLenum QGLFramebufferObjectFormat::internalTextureFormat() const
{
return d->internal_format;
}
@@ -263,9 +264,9 @@ void QGLFramebufferObjectFormat::setTextureTarget(QMacCompatGLenum target)
}
/*! \internal */
-void QGLFramebufferObjectFormat::setInternalFormat(QMacCompatGLenum internalFormat)
+void QGLFramebufferObjectFormat::setInternalTextureFormat(QMacCompatGLenum internalTextureFormat)
{
- d->internal_format = internalFormat;
+ d->internal_format = internalTextureFormat;
}
#endif
@@ -479,7 +480,7 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At
format.setTextureTarget(target);
format.setSamples(int(samples));
format.setAttachment(fbo_attachment);
- format.setInternalFormat(internal_format);
+ format.setInternalTextureFormat(internal_format);
}
/*!
@@ -636,7 +637,7 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, const QGLFramebuff
: d_ptr(new QGLFramebufferObjectPrivate)
{
Q_D(QGLFramebufferObject);
- d->init(size, format.attachment(), format.textureTarget(), format.internalFormat(), format.samples());
+ d->init(size, format.attachment(), format.textureTarget(), format.internalTextureFormat(), format.samples());
}
/*! \overload
@@ -649,7 +650,7 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, const QGLFrame
: d_ptr(new QGLFramebufferObjectPrivate)
{
Q_D(QGLFramebufferObject);
- d->init(QSize(width, height), format.attachment(), format.textureTarget(), format.internalFormat(), format.samples());
+ d->init(QSize(width, height), format.attachment(), format.textureTarget(), format.internalTextureFormat(), format.samples());
}
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index ad14e50..ec1ae7d 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -151,12 +151,12 @@ public:
void setTextureTarget(GLenum target);
GLenum textureTarget() const;
- void setInternalFormat(GLenum internalFormat);
- GLenum internalFormat() const;
+ void setInternalTextureFormat(GLenum internalTextureFormat);
+ GLenum internalTextureFormat() const;
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
void setTextureTarget(QMacCompatGLenum target);
- void setInternalFormat(QMacCompatGLenum internalFormat);
+ void setInternalTextureFormat(QMacCompatGLenum internalTextureFormat);
#endif
private:
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index 56e5baa..68db9c0 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -324,7 +324,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const
filter->setSource(generateBlurShader(radius(), quality() == Qt::SmoothTransformation));
QGLFramebufferObjectFormat format;
- format.setInternalFormat(GLenum(src.hasAlphaChannel() ? GL_RGBA : GL_RGB));
+ format.setInternalTextureFormat(GLenum(src.hasAlphaChannel() ? GL_RGBA : GL_RGB));
QGLFramebufferObject *fbo = qgl_fbo_pool()->acquire(src.size(), format);
if (!fbo)
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index b6f5012..d63d2ad 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -84,7 +84,7 @@ QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize
if (format.samples() == requestFormat.samples()
&& format.attachment() == requestFormat.attachment()
&& format.textureTarget() == requestFormat.textureTarget()
- && format.internalFormat() == requestFormat.internalFormat())
+ && format.internalTextureFormat() == requestFormat.internalTextureFormat())
{
// choose the fbo with a matching format and the closest size
if (!candidate || areaDiff(requestSize, candidate) > areaDiff(requestSize, fbo))
@@ -467,7 +467,7 @@ QPaintEngine* QGLPixmapData::paintEngine() const
QGLFramebufferObjectFormat format;
format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
format.setSamples(4);
- format.setInternalFormat(GLenum(m_hasAlpha ? GL_RGBA : GL_RGB));
+ format.setInternalTextureFormat(GLenum(m_hasAlpha ? GL_RGBA : GL_RGB));
m_renderFbo = qgl_fbo_pool()->acquire(size(), format);
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index f974938..a85b9ae 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -569,7 +569,7 @@ void QGLWindowSurface::updateGeometry()
QGLFramebufferObjectFormat format;
format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
- format.setInternalFormat(GLenum(GL_RGBA));
+ format.setInternalTextureFormat(GLenum(GL_RGBA));
format.setTextureTarget(target);
if (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit)