diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-04-16 08:55:12 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-04-16 15:28:26 (GMT) |
commit | a241ebac49f01ba0e26a177f1aadbd18c7e9cae7 (patch) | |
tree | c7e577ecf60c990a1a5a1902ba0637bd3187a4d6 /src/opengl/qpixmapdata_gl_p.h | |
parent | 1e1371e19ae62a5bf57dcad8d53ac70dcd2ad0cb (diff) | |
download | Qt-a241ebac49f01ba0e26a177f1aadbd18c7e9cae7.zip Qt-a241ebac49f01ba0e26a177f1aadbd18c7e9cae7.tar.gz Qt-a241ebac49f01ba0e26a177f1aadbd18c7e9cae7.tar.bz2 |
Use FBOs as pixmap backend in GL graphics system.
We now use FBOs to implement render-to-pixmap for the GL pixmap backend.
A multisample FBO is used for rendering, and is then blitted onto a
non-multisample FBO dynamically bound to the relevant texture.
Reviewed-by: Tom
Diffstat (limited to 'src/opengl/qpixmapdata_gl_p.h')
-rw-r--r-- | src/opengl/qpixmapdata_gl_p.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index 97f4959..b1b31f7 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -60,6 +60,7 @@ QT_BEGIN_NAMESPACE class QPaintEngine; +class QGLFramebufferObject; class QGLPixmapData : public QPixmapData { @@ -72,6 +73,7 @@ public: void resize(int width, int height); void fromImage(const QImage &image, Qt::ImageConversionFlags flags); + void copy(const QPixmapData *data, const QRect &rect); bool scroll(int dx, int dy, const QRect &rect); @@ -87,6 +89,17 @@ public: void ensureCreated() const; + bool isUninitialized() const { return m_dirty && m_source.isNull(); } + + QSize size() const { return QSize(m_width, m_height); } + int width() const { return m_width; } + int height() const { return m_height; } + + QGLFramebufferObject *fbo() const; + + void beginPaint(); + void endPaint(); + protected: int metric(QPaintDevice::PaintDeviceMetric metric) const; @@ -94,11 +107,15 @@ private: QGLPixmapData(const QGLPixmapData &other); QGLPixmapData &operator=(const QGLPixmapData &other); + static bool useFramebufferObjects(); + int m_width; int m_height; + mutable QGLFramebufferObject *m_renderFbo; + mutable uint m_textureId; + mutable QPaintEngine *m_engine; mutable QGLContext *m_ctx; - mutable GLuint m_texture; mutable bool m_dirty; mutable QImage m_source; }; |