File indexing completed on 2025-02-21 10:12:16
0001
0002
0003
0004 #ifndef QOPENGLPAINTDEVICE_H
0005 #define QOPENGLPAINTDEVICE_H
0006
0007 #include <QtOpenGL/qtopenglglobal.h>
0008
0009 #ifndef QT_NO_OPENGL
0010
0011 #include <QtGui/qpaintdevice.h>
0012 #include <QtGui/qopengl.h>
0013 #include <QtGui/qopenglcontext.h>
0014
0015 QT_BEGIN_NAMESPACE
0016
0017 class QOpenGLPaintDevicePrivate;
0018
0019 class Q_OPENGL_EXPORT QOpenGLPaintDevice : public QPaintDevice
0020 {
0021 Q_DECLARE_PRIVATE(QOpenGLPaintDevice)
0022 public:
0023 QOpenGLPaintDevice();
0024 explicit QOpenGLPaintDevice(const QSize &size);
0025 QOpenGLPaintDevice(int width, int height);
0026 ~QOpenGLPaintDevice();
0027
0028 int devType() const override { return QInternal::OpenGL; }
0029 QPaintEngine *paintEngine() const override;
0030
0031 QOpenGLContext *context() const;
0032 QSize size() const;
0033 void setSize(const QSize &size);
0034 void setDevicePixelRatio(qreal devicePixelRatio);
0035
0036 qreal dotsPerMeterX() const;
0037 qreal dotsPerMeterY() const;
0038
0039 void setDotsPerMeterX(qreal);
0040 void setDotsPerMeterY(qreal);
0041
0042 void setPaintFlipped(bool flipped);
0043 bool paintFlipped() const;
0044
0045 virtual void ensureActiveTarget();
0046
0047 protected:
0048 QOpenGLPaintDevice(QOpenGLPaintDevicePrivate &dd);
0049 int metric(QPaintDevice::PaintDeviceMetric metric) const override;
0050
0051 Q_DISABLE_COPY(QOpenGLPaintDevice)
0052 QScopedPointer<QOpenGLPaintDevicePrivate> d_ptr;
0053 };
0054
0055 QT_END_NAMESPACE
0056
0057 #endif
0058
0059 #endif