diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 6 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 5 | ||||
-rw-r--r-- | src/opengl/qgl.h | 3 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject.h | 2 | ||||
-rw-r--r-- | src/opengl/qglpaintdevice_qws.cpp | 2 | ||||
-rw-r--r-- | src/opengl/qglpaintdevice_qws_p.h | 3 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer.h | 2 | ||||
-rw-r--r-- | src/opengl/qpaintengine_opengl.cpp | 2 |
10 files changed, 12 insertions, 15 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a3475c7..62090a5 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1199,7 +1199,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) if (d->ctx->d_ptr->active_engine) { QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(d->ctx->d_ptr->active_engine); - QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr); + QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr.data()); p->transferMode(BrushDrawingMode); p->drawable.doneCurrent(); } @@ -1283,7 +1283,7 @@ bool QGL2PaintEngineEx::end() if (ctx->d_ptr->active_engine != this) { QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(ctx->d_ptr->active_engine); if (engine && engine->isActive()) { - QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr); + QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr.data()); p->transferMode(BrushDrawingMode); p->drawable.doneCurrent(); } @@ -1315,7 +1315,7 @@ void QGL2PaintEngineEx::ensureActive() if (isActive() && ctx->d_ptr->active_engine != this) { QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(ctx->d_ptr->active_engine); if (engine && engine->isActive()) { - QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr); + QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr.data()); p->transferMode(BrushDrawingMode); p->drawable.doneCurrent(); } diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0631df5..bd7daf2 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1599,8 +1599,8 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg() */ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device) + : d_ptr(new QGLContextPrivate(this)) { - d_ptr = new QGLContextPrivate(this); Q_D(QGLContext); d->init(device, format); } @@ -1622,8 +1622,8 @@ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device) \sa format(), isValid() */ QGLContext::QGLContext(const QGLFormat &format) + : d_ptr(new QGLContextPrivate(this)) { - d_ptr = new QGLContextPrivate(this); Q_D(QGLContext); d->init(0, format); } @@ -1641,7 +1641,6 @@ QGLContext::~QGLContext() QGLSignalProxy::instance()->emitAboutToDestroyContext(this); reset(); - delete d; } void QGLContextPrivate::cleanup() diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 31b9543..9ee200b 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -45,6 +45,7 @@ #include <QtGui/qwidget.h> #include <QtOpenGL/qglcolormap.h> #include <QtCore/qmap.h> +#include <QtCore/qscopedpointer.h> QT_BEGIN_HEADER @@ -348,7 +349,7 @@ protected: static QGLContext* currentCtx; private: - QGLContextPrivate* d_ptr; + QScopedPointer<QGLContextPrivate> d_ptr; friend class QGLPixelBuffer; friend class QGLPixelBufferPrivate; diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index abec78a..0577f9a 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -736,7 +736,6 @@ QGLFramebufferObject::~QGLFramebufferObject() glDeleteRenderbuffers(1, &d->depth_stencil_buffer); glDeleteFramebuffers(1, &d->fbo); } - delete d_ptr; } /*! diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h index bd60198..108bbb4 100644 --- a/src/opengl/qglframebufferobject.h +++ b/src/opengl/qglframebufferobject.h @@ -129,7 +129,7 @@ protected: private: Q_DISABLE_COPY(QGLFramebufferObject) - QGLFramebufferObjectPrivate *d_ptr; + QScopedPointer<QGLFramebufferObjectPrivate> d_ptr; friend class QGLDrawable; }; diff --git a/src/opengl/qglpaintdevice_qws.cpp b/src/opengl/qglpaintdevice_qws.cpp index 2093464..60816de 100644 --- a/src/opengl/qglpaintdevice_qws.cpp +++ b/src/opengl/qglpaintdevice_qws.cpp @@ -68,8 +68,6 @@ QWSGLPaintDevice::QWSGLPaintDevice(QWidget *widget) : QWSGLPaintDevice::~QWSGLPaintDevice() { - Q_D(QWSGLPaintDevice); - delete d; } QPaintEngine* QWSGLPaintDevice::paintEngine() const diff --git a/src/opengl/qglpaintdevice_qws_p.h b/src/opengl/qglpaintdevice_qws_p.h index 9aeb11f..ec7d6c8 100644 --- a/src/opengl/qglpaintdevice_qws_p.h +++ b/src/opengl/qglpaintdevice_qws_p.h @@ -53,6 +53,7 @@ // We mean it. // +#include <QtCore/qscopedpointer.h> #include <QPaintDevice> QT_BEGIN_NAMESPACE @@ -76,7 +77,7 @@ public: private: friend class QWSGLWindowSurface; - QWSGLPaintDevicePrivate *d_ptr; + QScopedPointer<QWSGLPaintDevicePrivate> d_ptr; }; diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 440694d..e40a037 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -191,7 +191,6 @@ QGLPixelBuffer::~QGLPixelBuffer() delete d->qctx; if (current && current != d->qctx) current->makeCurrent(); - delete d_ptr; } /*! \fn bool QGLPixelBuffer::makeCurrent() diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h index 46ca67e..06894c0 100644 --- a/src/opengl/qglpixelbuffer.h +++ b/src/opengl/qglpixelbuffer.h @@ -107,7 +107,7 @@ protected: private: Q_DISABLE_COPY(QGLPixelBuffer) - QGLPixelBufferPrivate *d_ptr; + QScopedPointer<QGLPixelBufferPrivate> d_ptr; friend class QGLDrawable; friend class QGLWindowSurface; }; diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 685d0f5..63ce73a 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5420,7 +5420,7 @@ void QOpenGLPaintEngine::fill(const QVectorPath &path, const QBrush &brush) QPainter *p = painter(); QBrush oldBrush = p->brush(); p->setBrush(brush); - qt_draw_helper(p->d_ptr, painterPathFromVectorPath(path), QPainterPrivate::FillDraw); + qt_draw_helper(p->d_ptr.data(), painterPathFromVectorPath(path), QPainterPrivate::FillDraw); p->setBrush(oldBrush); return; } |