diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-08-31 11:28:14 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-08 16:36:14 (GMT) |
commit | b7963df603a315136b32297b861f089c0cd49acd (patch) | |
tree | 797d95a3be461b1b76585cf67a09a02ae092f184 /src/opengl/qglpixelbuffer_p.h | |
parent | 7c59abc1883a24e54ac3bb2193acc2cac5ad416a (diff) | |
download | Qt-b7963df603a315136b32297b861f089c0cd49acd.zip Qt-b7963df603a315136b32297b861f089c0cd49acd.tar.gz Qt-b7963df603a315136b32297b861f089c0cd49acd.tar.bz2 |
Make QGLPixelBuffer work again using new QGLPaintDevice API
Add a new QGLPBufferGLPaintDevice implementation which allows the GL
engines to target QGLPixelBuffers again.
Diffstat (limited to 'src/opengl/qglpixelbuffer_p.h')
-rw-r--r-- | src/opengl/qglpixelbuffer_p.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/opengl/qglpixelbuffer_p.h b/src/opengl/qglpixelbuffer_p.h index 74cb330..e24d1ea 100644 --- a/src/opengl/qglpixelbuffer_p.h +++ b/src/opengl/qglpixelbuffer_p.h @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE #include "QtOpenGL/qglpixelbuffer.h" #include <private/qgl_p.h> +#include <private/qglpaintdevice_p.h> #if defined(Q_WS_X11) && !defined(QT_OPENGL_ES) #include <GL/glx.h> @@ -135,6 +136,17 @@ QT_END_INCLUDE_NAMESPACE class QEglContext; + +class QGLPBufferGLPaintDevice : public QGLPaintDevice +{ +public: + virtual QPaintEngine* paintEngine() const {return pbuf->paintEngine();} + virtual QSize size() const {return pbuf->size();} + void setPBuffer(QGLPixelBuffer* pb); +private: + QGLPixelBuffer* pbuf; +}; + class QGLPixelBufferPrivate { Q_DECLARE_PUBLIC(QGLPixelBuffer) public: @@ -154,6 +166,7 @@ public: QGLPixelBuffer *q_ptr; bool invalid; QGLContext *qctx; + QGLPBufferGLPaintDevice glDevice; QGLFormat format; QGLFormat req_format; |