summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglframebufferobject.cpp37
-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, 25 insertions, 26 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index a03e627..94e3930 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,16 +264,16 @@ 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
class QGLFramebufferObjectPrivate
{
public:
- QGLFramebufferObjectPrivate() : depth_stencil_buffer(0), valid(false), bound(false), ctx(0), previous_fbo(0), engine(0) {}
+ QGLFramebufferObjectPrivate() : depth_stencil_buffer(0), valid(false), ctx(0), previous_fbo(0), engine(0) {}
~QGLFramebufferObjectPrivate() {}
void init(const QSize& sz, QGLFramebufferObject::Attachment attachment,
@@ -286,7 +287,6 @@ public:
QSize size;
QGLFramebufferObjectFormat format;
uint valid : 1;
- uint bound : 1;
QGLFramebufferObject::Attachment fbo_attachment;
QGLContext *ctx; // for Windows extension ptrs
GLuint previous_fbo;
@@ -479,7 +479,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 +636,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 +649,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
@@ -791,7 +791,7 @@ bool QGLFramebufferObject::bind()
Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo);
- d->bound = d->valid = d->checkFramebufferStatus();
+ d->valid = d->checkFramebufferStatus();
const QGLContext *context = QGLContext::currentContext();
if (d->valid && context) {
// Save the previous setting to automatically restore in release().
@@ -822,7 +822,6 @@ bool QGLFramebufferObject::release()
return false;
Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
- d->bound = false;
const QGLContext *context = QGLContext::currentContext();
if (context) {
@@ -1101,7 +1100,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const
bool QGLFramebufferObject::isBound() const
{
Q_D(const QGLFramebufferObject);
- return d->bound;
+ return d->ctx->d_ptr->current_fbo == d->fbo;
}
/*!
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)