Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qopenglpaintdevice.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QOPENGLPAINTDEVICE_H
6#define QOPENGLPAINTDEVICE_H
7
8#include <QtOpenGL/qtopenglglobal.h>
9
10#ifndef QT_NO_OPENGL
11
12#include <QtGui/qpaintdevice.h>
13#include <QtGui/qopengl.h>
14#include <QtGui/qopenglcontext.h>
15
17
18class QOpenGLPaintDevicePrivate;
19
20class Q_OPENGL_EXPORT QOpenGLPaintDevice : public QPaintDevice
21{
22 Q_DECLARE_PRIVATE(QOpenGLPaintDevice)
23public:
24 QOpenGLPaintDevice();
25 explicit QOpenGLPaintDevice(const QSize &size);
26 QOpenGLPaintDevice(int width, int height);
27 ~QOpenGLPaintDevice();
28
29 int devType() const override { return QInternal::OpenGL; }
30 QPaintEngine *paintEngine() const override;
31
32 QOpenGLContext *context() const;
33 QSize size() const;
34 void setSize(const QSize &size);
35 void setDevicePixelRatio(qreal devicePixelRatio);
36
37 qreal dotsPerMeterX() const;
38 qreal dotsPerMeterY() const;
39
40 void setDotsPerMeterX(qreal);
41 void setDotsPerMeterY(qreal);
42
43 void setPaintFlipped(bool flipped);
44 bool paintFlipped() const;
45
46 virtual void ensureActiveTarget();
47
48protected:
49 QOpenGLPaintDevice(QOpenGLPaintDevicePrivate &dd);
50 int metric(QPaintDevice::PaintDeviceMetric metric) const override;
51
52 Q_DISABLE_COPY(QOpenGLPaintDevice)
53 QScopedPointer<QOpenGLPaintDevicePrivate> d_ptr;
54};
55
56QT_END_NAMESPACE
57
58#endif // QT_NO_OPENGL
59
60#endif // QOPENGLPAINTDEVICE_H
QOpenGLEngineShaderManager * shaderManager
void drawVertexArrays(QOpenGL2PEXVertexArray &vertexArray, GLenum primitive)
bool uploadIndexData(const void *data, GLenum indexValueType, GLuint count)
static void cleanupVectorPath(QPaintEngineEx *engine, void *data)
void writeClip(const QVectorPath &path, uint value)
void updateTexture(GLenum textureUnit, const T &texture, GLenum wrapMode, GLenum filterMode, TextureUpdateMode updateMode=UpdateIfNeeded)
QOpenGL2PaintEngineExPrivate(QOpenGL2PaintEngineEx *q_ptr)
QOpenGL2PEXVertexArray vertexCoordinateArray
QFontEngine::GlyphFormat glyphCacheFormat
QVarLengthArray< GLuint, 8 > unusedVBOSToClean
void transferMode(EngineMode newMode)
void composite(const QOpenGLRect &boundingRect)
GLuint bindTexture(const T &texture, bool *newTextureCreated)
bool prepareForCachedGlyphDraw(const QFontEngineGlyphCache &cache)
void stroke(const QVectorPath &path, const QPen &pen)
QOpenGL2PEXVertexArray textureCoordinateArray
void drawTexture(const QOpenGLRect &dest, const QOpenGLRect &src, const QSize &textureSize, bool opaque, bool pattern=false)
void activateTextureUnit(GLenum textureUnit)
static QOpenGLEngineShaderManager * shaderManagerForEngine(QOpenGL2PaintEngineEx *engine)
void setVertexAttribArrayEnabled(int arrayIndex, bool enabled=true)
void uploadData(unsigned int arrayIndex, const GLfloat *data, GLuint count)
void fill(const QVectorPath &path)
void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints hints)
bool prepareForDraw(bool srcPixelsAreOpaque)
void drawCachedGlyphs(QFontEngine::GlyphFormat glyphFormat, QStaticTextItem *staticTextItem)
void fillStencilWithVertexArray(const float *data, int count, int *stops, int stopCount, const QOpenGLRect &bounds, StencilFillMode mode)
void setBrush(const QBrush &brush)
void drawVertexArrays(const float *data, int *stops, int stopCount, GLenum primitive)
void fillStencilWithVertexArray(QOpenGL2PEXVertexArray &vertexArray, bool useWindingFill)
void setScissor(const QRect &rect)
bool vertexAttributeArraysEnabledState[QT_GL_VERTEX_ARRAY_TRACKED_COUNT]
QDataBuffer< GLfloat > opacityArray
QPointer< QOpenGLContext > ctx
GLuint location(const QOpenGLEngineShaderManager::Uniform uniform)
static QOpenGL2PaintEngineExPrivate * getData(QOpenGL2PaintEngineEx *engine)
QVarLengthArray< GLuint, 8 > unusedIBOSToClean
QOpenGL2PaintEngineState(const QOpenGL2PaintEngineState &other)
QPointer< QOpenGLEngineShaderManager > m_manager
virtual void setUniforms(QOpenGLShaderProgram *)
bool operator==(const QOpenGLEngineShaderProg &other) const
The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.
friend class QPainter
Combined button and popup list for selecting options.
static const GLuint QT_TEXTURE_COORDS_ATTR
static const GLuint QT_PMV_MATRIX_2_ATTR
static const GLuint QT_OPACITY_ATTR
static const GLuint QT_PMV_MATRIX_1_ATTR
static QT_BEGIN_NAMESPACE const GLuint QT_VERTEX_COORDS_ATTR
static const GLuint QT_PMV_MATRIX_3_ATTR
#define QT_GL_VERTEX_ARRAY_TRACKED_COUNT
#define QT_UNKNOWN_TEXTURE_UNIT