42 #ifndef QGRAPHICSCONTEXT_OPENGL2_P_H 43 #define QGRAPHICSCONTEXT_OPENGL2_P_H 58 #include <private/qpaintengineex_p.h> 59 #include <private/qglengineshadermanager_p.h> 60 #include <private/qgl2pexvertexarray_p.h> 61 #include <private/qglpaintdevice_p.h> 62 #include <private/qglpixmapfilter_p.h> 63 #include <private/qfontengine_p.h> 64 #include <private/qdatabuffer_p.h> 65 #include <private/qtriangulatingstroker_p.h> 77 #define GL_STENCIL_HIGH_BIT GLuint(0x80) 78 #define QT_BRUSH_TEXTURE_UNIT GLuint(0) 79 #define QT_IMAGE_TEXTURE_UNIT GLuint(0) //Can be the same as brush texture unit 80 #define QT_MASK_TEXTURE_UNIT GLuint(1) 81 #define QT_BACKGROUND_TEXTURE_UNIT GLuint(2) 118 virtual void clipEnabledChanged();
119 virtual void penChanged();
120 virtual void brushChanged();
121 virtual void brushOriginChanged();
125 virtual void transformChanged();
129 QPainter::PixmapFragmentHints hints);
130 virtual void drawPixmapFragments(
const QRectF *targetRects,
const QRectF *sourceRects,
int fragmentCount,
const QPixmap &pixmap,
131 QPainter::PixmapFragmentHints hints);
154 void beginNativePainting();
155 void endNativePainting();
157 void invalidateState();
161 void setRenderTextActive(
bool);
163 bool isNativePaintingActive()
const;
176 TriStripStrokeFillMode
185 elementIndicesVBOId(0),
187 snapToPixelGrid(false),
188 nativePaintingActive(false),
190 lastMaskTextureUsed(0),
191 hasCompatibilityExtension(false)
196 void updateBrushTexture();
197 void updateBrushUniforms();
199 void updateCompositionMode();
210 QPainter::PixmapFragmentHints hints);
211 void drawPixmapFragments(
const QRectF *targetRects,
const QRectF *sourceRects,
int fragmentCount,
const QPixmap &pixmap,
const QSize &size,
212 QPainter::PixmapFragmentHints hints);
216 inline void setVertexAttributePointer(
unsigned int arrayIndex,
const GLfloat *pointer);
219 void drawVertexArrays(
const float *
data,
int *stops,
int stopCount,
GLenum primitive);
221 drawVertexArrays((
const float *) vertexArray.
data(), vertexArray.
stops(), vertexArray.
stopCount(), primitive);
228 void fillStencilWithVertexArray(
const float *data,
int count,
int *stops,
int stopCount,
const QGLRect &bounds,
StencilFillMode mode);
230 fillStencilWithVertexArray((
const float *) vertexArray.
data(), 0, vertexArray.
stops(), vertexArray.
stopCount(),
232 useWindingFill ? WindingFillMode : OddEvenFillMode);
237 bool prepareForDraw(
bool srcPixelsAreOpaque);
238 inline void useSimpleShader();
240 return shaderManager->getUniformLocation(uniform);
243 void clearClip(
uint value);
245 void resetClipIfNeeded();
247 void updateClipScissorTest();
248 void setScissor(
const QRect &rect);
249 void regenerateClip();
250 void systemStateChanged();
255 static void cleanupVectorPath(
QPaintEngineEx *engine,
void *data);
291 GLfloat staticVertexCoordinateArray[8];
292 GLfloat staticTextureCoordinateArray[8];
296 GLfloat pmvMatrix[3][3];
305 GLfloat depthRange[2];
321 const GLfloat *vertexAttribPointers[3];
330 if (pointer == vertexAttribPointers[arrayIndex])
333 vertexAttribPointers[arrayIndex] = pointer;
QVector< GLuint > unusedIBOSToClean
QSet< QVectorPath::CacheEntry * > pathCaches
void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer)
static QGLEngineShaderManager * shaderManagerForEngine(QGL2PaintEngineEx *engine)
#define QT_END_NAMESPACE
This macro expands to.
bool multisamplingAlwaysEnabled
static QGL2PaintEngineExPrivate * getData(QGL2PaintEngineEx *engine)
bool hasCompatibilityExtension
QGLEngineShaderManager * shaderManager
uint compositionModeChanged
QGL2PEXVertexArray textureCoordinateArray
The QPointF class defines a point in the plane using floating point precision.
QRect currentScissorBounds
#define glVertexAttribPointer
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
GLuint elementIndicesVBOId
QVector< GLushort > elementIndices
The QPen class defines how a QPainter should draw lines and outlines of shapes.
QDashedStrokeProcessor dasher
GLuint location(const QGLEngineShaderManager::Uniform uniform)
static const GLuint QT_OPACITY_ATTR
static const QRectF boundingRect(const QPointF *points, int pointCount)
QFontEngineGlyphCache::Type glyphCacheType
QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr)
QScopedPointer< QPixmapFilter > colorizeFilter
const QOpenGL2PaintEngineState * state() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
QBrush brush() const
Returns the brush in the current paint engine state.
QScopedPointer< QPixmapFilter > dropShadowFilter
The QRectF class defines a rectangle in the plane using floating point precision. ...
void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive)
QDataBuffer< GLfloat > opacityArray
The QGLContext class encapsulates an OpenGL rendering context.
QRegion dirtyStencilRegion
QGLRect boundingRect() const
QGL2PEXVertexArray vertexCoordinateArray
QVector< GLuint > unusedVBOSToClean
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
The QRegion class specifies a clip region for a painter.
QOpenGL2PaintEngineState()
QTriangulatingStroker stroker
static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, const QRectF &src=QRectF())
QOpenGL2PaintEngineState * state()
The QBrush class defines the fill pattern of shapes drawn by QPainter.
static QByteArray prototype(const QList< QByteArray > ¶meterTypes, const QList< QByteArray > ¶meterNames, bool *ok)
#define Q_DECLARE_PUBLIC(Class)
This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a ...
The QPixmapFilter class provides the basic functionality for pixmap filter classes.
static void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform)
bool compositionModeDirty
The QRect class defines a rectangle in the plane using integer precision.
QScopedPointer< QPixmapFilter > convolutionFilter
QPixmap currentBrushPixmap
bool supportsTransformations(qreal, const QTransform &) const
The QPixmap class is an off-screen image representation that can be used as a paint device...
bool nativePaintingActive
~QOpenGL2PaintEngineState()
GLuint lastMaskTextureUsed
uint needsClipBufferClear
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
QPen pen() const
Returns the pen in the current paint engine state.
The QTextItem class provides all the information required to draw text in a custom paint engine...
QScopedPointer< QPixmapFilter > blurFilter
static const KeyPair *const end
Type type() const
Reimplement this function to return the paint engine Type.
void fillStencilWithVertexArray(QGL2PEXVertexArray &vertexArray, bool useWindingFill)