4#ifndef QOPENGLPAINTENGINE_P_H
5#define QOPENGLPAINTENGINE_P_H
22#include <private/qpaintengineex_p.h>
23#include <private/qopenglengineshadermanager_p.h>
24#include <private/qopengl2pexvertexarray_p.h>
25#include <private/qfontengine_p.h>
26#include <private/qdatabuffer_p.h>
27#include <private/qtriangulatingstroker_p.h>
29#include <private/qopenglextensions_p.h>
31#include <QOpenGLVertexArrayObject>
32#include <QOpenGLBuffer>
44#define GL_STENCIL_HIGH_BIT GLuint(0x80)
45#define QT_UNKNOWN_TEXTURE_UNIT GLuint(-1)
46#define QT_DEFAULT_TEXTURE_UNIT GLuint(0)
47#define QT_BRUSH_TEXTURE_UNIT GLuint(0)
48#define QT_IMAGE_TEXTURE_UNIT GLuint(0)
49#define QT_MASK_TEXTURE_UNIT GLuint(1)
50#define QT_BACKGROUND_TEXTURE_UNIT GLuint(2)
97 QPainter::PixmapFragmentHints hints)
override;
123 void invalidateState();
127 bool isNativePaintingActive()
const;
139#define QT_GL_VERTEX_ARRAY_TRACKED_COUNT 3
148 TriStripStrokeFillMode
157 elementIndicesVBOId(0),
159 snapToPixelGrid(
false),
160 nativePaintingActive(
false),
171 void updateBrushTexture();
172 void updateBrushUniforms();
174 void updateCompositionMode();
178 void updateTexture(
GLenum textureUnit,
const T &
texture,
GLenum wrapMode,
GLenum filterMode, TextureUpdateMode updateMode = UpdateIfNeeded);
181 void activateTextureUnit(
GLenum textureUnit);
191 QPainter::PixmapFragmentHints hints);
199 void drawVertexArrays(
const float *
data,
int *stops,
int stopCount,
GLenum primitive);
201 drawVertexArrays((
const float *) vertexArray.
data(), vertexArray.
stops(), vertexArray.
stopCount(), primitive);
208 void fillStencilWithVertexArray(
const float *
data,
int count,
int *stops,
int stopCount,
const QOpenGLRect &bounds, StencilFillMode
mode);
210 fillStencilWithVertexArray((
const float *) vertexArray.
data(), 0, vertexArray.
stops(), vertexArray.
stopCount(),
212 useWindingFill ? WindingFillMode : OddEvenFillMode);
217 bool prepareForDraw(
bool srcPixelsAreOpaque);
219 inline void useSimpleShader();
221 return shaderManager->getUniformLocation(uniform);
226 void resetClipIfNeeded();
228 void updateClipScissorTest();
230 void regenerateClip();
231 void systemStateChanged()
override;
233 void setVertexAttribArrayEnabled(
int arrayIndex,
bool enabled =
true);
312 vertexBuffer.allocate(
data,
count *
sizeof(
float));
315 texCoordBuffer.bind();
316 texCoordBuffer.allocate(
data,
count *
sizeof(
float));
319 opacityBuffer.bind();
320 opacityBuffer.allocate(
data,
count *
sizeof(
float));
322 funcs.glVertexAttribPointer(arrayIndex, 1,
GL_FLOAT, GL_FALSE, 0,
nullptr);
324 funcs.glVertexAttribPointer(arrayIndex, 2,
GL_FLOAT, GL_FALSE, 0,
nullptr);
330 Q_ASSERT(indexValueType == GL_UNSIGNED_SHORT || indexValueType == GL_UNSIGNED_INT);
332 indexBuffer.allocate(
IOBluetoothDevice * device
QOpenGLRect boundingRect() const
QOpenGLEngineShaderManager * shaderManager
void drawVertexArrays(QOpenGL2PEXVertexArray &vertexArray, GLenum primitive)
bool uploadIndexData(const void *data, GLenum indexValueType, GLuint count)
GLuint elementIndicesVBOId
QOpenGL2PaintEngineExPrivate(QOpenGL2PaintEngineEx *q_ptr)
QOpenGL2PEXVertexArray vertexCoordinateArray
QFontEngine::GlyphFormat glyphCacheFormat
QOpenGLBuffer vertexBuffer
QDashedStrokeProcessor dasher
QVarLengthArray< GLuint, 8 > unusedVBOSToClean
QList< GLushort > elementIndices
QRect currentScissorBounds
QOpenGLBuffer opacityBuffer
bool multisamplingAlwaysEnabled
GLuint bindTexture(const T &texture, bool *newTextureCreated)
QOpenGL2PEXVertexArray textureCoordinateArray
QOpenGLBuffer texCoordBuffer
void drawTexture(const QOpenGLRect &dest, const QOpenGLRect &src, const QSize &textureSize, bool opaque, bool pattern=false)
static QOpenGLEngineShaderManager * shaderManagerForEngine(QOpenGL2PaintEngineEx *engine)
bool compositionModeDirty
QRegion dirtyStencilRegion
QTriangulatingStroker stroker
QOpenGLPaintDevice * device
void uploadData(unsigned int arrayIndex, const GLfloat *data, GLuint count)
QOpenGLBuffer indexBuffer
QOpenGLVertexArrayObject vao
QOpenGL2PaintEngineEx * q
void fillStencilWithVertexArray(QOpenGL2PEXVertexArray &vertexArray, bool useWindingFill)
QDataBuffer< GLfloat > opacityArray
GLuint location(const QOpenGLEngineShaderManager::Uniform uniform)
GLenum lastTextureUnitUsed
static QOpenGL2PaintEngineExPrivate * getData(QOpenGL2PaintEngineEx *engine)
QVarLengthArray< GLuint, 8 > unusedIBOSToClean
bool nativePaintingActive
Type type() const override
Reimplement this function to return the paint engine \l{Type}.
void setRenderTextActive(bool)
bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const override
QOpenGL2PaintEngineState * state()
const QOpenGL2PaintEngineState * state() const
uint compositionModeChanged
uint needsClipBufferClear
QOpenGL2PaintEngineState()
~QOpenGL2PaintEngineState()
The QOpenGLBuffer class provides functions for creating and managing OpenGL buffer objects.
The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.
The QOpenGLVertexArrayObject class wraps an OpenGL Vertex Array Object.
virtual void renderHintsChanged()=0
virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QFlags< QPainter::PixmapFragmentHint > hints)
virtual void penChanged()=0
virtual void stroke(const QVectorPath &path, const QPen &pen)
virtual void beginNativePainting()
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override=0
Reimplement this function to draw the part of the image specified by the sr rectangle in the given re...
virtual void clip(const QVectorPath &path, Qt::ClipOperation op)=0
virtual void clipEnabledChanged()=0
virtual void endNativePainting()
virtual void fill(const QVectorPath &path, const QBrush &brush)=0
virtual void opacityChanged()=0
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override=0
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
virtual void compositionModeChanged()=0
virtual void brushOriginChanged()=0
virtual QPainterState * createState(QPainterState *orig) const
virtual void brushChanged()=0
virtual void transformChanged()=0
virtual bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
virtual void setState(QPainterState *s)
virtual void drawStaticTextItem(QStaticTextItem *)
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.
virtual bool begin(QPaintDevice *pdev)=0
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
virtual bool end()=0
Reimplement this function to finish painting on the current paint device.
This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a ...
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
static VulkanServerBufferGlFunctions * funcs
QCache< int, Employee > cache
[0]
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static const GLuint QT_TEXTURE_COORDS_ATTR
static const GLuint QT_OPACITY_ATTR
static QT_BEGIN_NAMESPACE const GLuint QT_VERTEX_COORDS_ATTR
typedef GLfloat(GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
#define QT_GL_VERTEX_ARRAY_TRACKED_COUNT
@ ImageOpacityArrayDrawingMode
#define QT_UNKNOWN_TEXTURE_UNIT
static const QRectF boundingRect(const QPointF *points, int pointCount)