summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglframebufferobject_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-16 09:29:44 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-29 10:24:55 +0200
commitaaa4a26f82f99fa8724841eba91bad029306e0ce (patch)
tree3d24e874bff00efc0e73af610bc80e645d14f789 /src/opengl/qglframebufferobject_p.h
parent00fd783a39d55d2365ddead4fab2cc06091c119f (diff)
Move GL resource handling enablers to QtGui.
Made resource handling more robust by attempting to free GL resources in the correct thread, and not forcing a context to become current to free resources. Change-Id: Ie81d4005b608972375755571d9b50ce82080709b Reviewed-on: http://codereview.qt.nokia.com/3258 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/opengl/qglframebufferobject_p.h')
-rw-r--r--src/opengl/qglframebufferobject_p.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index f82361279d..61d39c6a07 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -130,8 +130,9 @@ private:
class QGLFramebufferObjectPrivate
{
public:
- QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_buffer(0), stencil_buffer(0)
- , color_buffer(0), valid(false), engine(0) {}
+ QGLFramebufferObjectPrivate() : fbo_guard(0), texture_guard(0), depth_buffer_guard(0)
+ , stencil_buffer_guard(0), color_buffer_guard(0)
+ , valid(false), engine(0) {}
~QGLFramebufferObjectPrivate() {}
void init(QGLFramebufferObject *q, const QSize& sz,
@@ -139,11 +140,11 @@ public:
GLenum internal_format, GLenum texture_target,
GLint samples = 0, bool mipmap = false);
bool checkFramebufferStatus() const;
- QGLSharedResourceGuard fbo_guard;
- GLuint texture;
- GLuint depth_buffer;
- GLuint stencil_buffer;
- GLuint color_buffer;
+ QGLSharedResourceGuardBase *fbo_guard;
+ QGLSharedResourceGuardBase *texture_guard;
+ QGLSharedResourceGuardBase *depth_buffer_guard;
+ QGLSharedResourceGuardBase *stencil_buffer_guard;
+ QGLSharedResourceGuardBase *color_buffer_guard;
GLenum target;
QSize size;
QGLFramebufferObjectFormat format;
@@ -152,7 +153,7 @@ public:
mutable QPaintEngine *engine;
QGLFBOGLPaintDevice glDevice;
- inline GLuint fbo() const { return fbo_guard.id(); }
+ inline GLuint fbo() const { return fbo_guard ? fbo_guard->id() : 0; }
};