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
4#ifndef QOPENGLPAINTDEVICE_H
5#define QOPENGLPAINTDEVICE_H
6
7#include <QtOpenGL/qtopenglglobal.h>
8
9#ifndef QT_NO_OPENGL
10
11#include <QtGui/qpaintdevice.h>
12#include <QtGui/qopengl.h>
13#include <QtGui/qopenglcontext.h>
14
16
17class QOpenGLPaintDevicePrivate;
18
19class Q_OPENGL_EXPORT QOpenGLPaintDevice : public QPaintDevice
20{
21 Q_DECLARE_PRIVATE(QOpenGLPaintDevice)
22public:
23 QOpenGLPaintDevice();
24 explicit QOpenGLPaintDevice(const QSize &size);
25 QOpenGLPaintDevice(int width, int height);
26 ~QOpenGLPaintDevice();
27
28 int devType() const override { return QInternal::OpenGL; }
29 QPaintEngine *paintEngine() const override;
30
31 QOpenGLContext *context() const;
32 QSize size() const;
33 void setSize(const QSize &size);
34 void setDevicePixelRatio(qreal devicePixelRatio);
35
36 qreal dotsPerMeterX() const;
37 qreal dotsPerMeterY() const;
38
39 void setDotsPerMeterX(qreal);
40 void setDotsPerMeterY(qreal);
41
42 void setPaintFlipped(bool flipped);
43 bool paintFlipped() const;
44
45 virtual void ensureActiveTarget();
46
47protected:
48 QOpenGLPaintDevice(QOpenGLPaintDevicePrivate &dd);
49 int metric(QPaintDevice::PaintDeviceMetric metric) const override;
50
51 Q_DISABLE_COPY(QOpenGLPaintDevice)
52 QScopedPointer<QOpenGLPaintDevicePrivate> d_ptr;
53};
54
55QT_END_NAMESPACE
56
57#endif // QT_NO_OPENGL
58
59#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