![]() |
Qt 6.x
The Qt SDK
|
#include <qopenglpaintengine_p.h>
Public Types | |
enum | StencilFillMode { OddEvenFillMode , WindingFillMode , TriStripStrokeFillMode } |
enum | TextureUpdateMode { UpdateIfNeeded , ForceUpdate } |
Static Public Member Functions | |
static QOpenGLEngineShaderManager * | shaderManagerForEngine (QOpenGL2PaintEngineEx *engine) |
static QOpenGL2PaintEngineExPrivate * | getData (QOpenGL2PaintEngineEx *engine) |
static void | cleanupVectorPath (QPaintEngineEx *engine, void *data) |
![]() | |
static QPaintEnginePrivate * | get (QPaintEngine *paintEngine) |
Definition at line 141 of file qopenglpaintengine_p.h.
Enumerator | |
---|---|
OddEvenFillMode | |
WindingFillMode | |
TriStripStrokeFillMode |
Definition at line 145 of file qopenglpaintengine_p.h.
Enumerator | |
---|---|
UpdateIfNeeded | |
ForceUpdate |
Definition at line 176 of file qopenglpaintengine_p.h.
|
inline |
Definition at line 151 of file qopenglpaintengine_p.h.
QOpenGL2PaintEngineExPrivate::~QOpenGL2PaintEngineExPrivate | ( | ) |
Definition at line 83 of file qopenglpaintengine.cpp.
References QOpenGLBuffer::destroy(), QOpenGLVertexArrayObject::destroy(), elementIndicesVBOId, funcs, QOpenGLFunctions::glDeleteBuffers(), indexBuffer, opacityBuffer, shaderManager, texCoordBuffer, vao, and vertexBuffer.
Definition at line 184 of file qopenglpaintengine.cpp.
References funcs, GL_TEXTURE0, QOpenGLFunctions::glActiveTexture(), GLuint, lastTextureUnitUsed, and lastTextureUsed.
Referenced by resetGLState(), and updateTexture().
GLuint QOpenGL2PaintEngineExPrivate::bindTexture | ( | const GLuint & | textureId, |
bool * | newTextureCreated | ||
) |
Definition at line 199 of file qopenglpaintengine.cpp.
References funcs, QOpenGLFunctions::glBindTexture(), and lastTextureUsed.
GLuint QOpenGL2PaintEngineExPrivate::bindTexture | ( | const ImageWithBindOptions & | imageWithOptions, |
bool * | newTextureCreated | ||
) |
Definition at line 249 of file qopenglpaintengine.cpp.
References QOpenGLTextureCache::bindTexture(), QOpenGLTextureCache::cacheForContext(), QOpenGLTextureCache::BindResult::flags, ImageWithBindOptions::image, QOpenGLTextureCache::NewTexture, and ImageWithBindOptions::options.
GLuint QOpenGL2PaintEngineExPrivate::bindTexture | ( | const QGradient & | gradient, |
bool * | newTextureCreated | ||
) |
Definition at line 229 of file qopenglpaintengine.cpp.
References bindTexture(), QOpenGL2GradientCache::cacheForContext(), QOpenGL2GradientCache::getBuffer(), and GLuint.
GLuint QOpenGL2PaintEngineExPrivate::bindTexture | ( | const QImage & | image, |
bool * | newTextureCreated | ||
) |
Definition at line 211 of file qopenglpaintengine.cpp.
References QOpenGLTextureCache::bindTexture(), QOpenGLTextureCache::cacheForContext(), QOpenGLTextureCache::BindResult::flags, and QOpenGLTextureCache::NewTexture.
GLuint QOpenGL2PaintEngineExPrivate::bindTexture | ( | const QPixmap & | pixmap, |
bool * | newTextureCreated | ||
) |
Definition at line 220 of file qopenglpaintengine.cpp.
References QOpenGLTextureCache::bindTexture(), QOpenGLTextureCache::cacheForContext(), QOpenGLTextureCache::BindResult::flags, QOpenGLTextureCache::NewTexture, and pixmap.
GLuint QOpenGL2PaintEngineExPrivate::bindTexture | ( | const T & | texture, |
bool * | newTextureCreated | ||
) |
|
static |
Definition at line 820 of file qopenglpaintengine.cpp.
References d, engine, QPaintEngine::OpenGL2, Q_ASSERT, and Q_UNUSED.
Referenced by fill().
Definition at line 2417 of file qopenglpaintengine.cpp.
References currentScissorBounds, dirtyStencilRegion, funcs, QOpenGLFunctions::glClear(), QOpenGLFunctions::glClearStencil(), and QOpenGLFunctions::glStencilMask().
Referenced by systemStateChanged(), and writeClip().
void QOpenGL2PaintEngineExPrivate::composite | ( | const QOpenGLRect & | boundingRect | ) |
Definition at line 1305 of file qopenglpaintengine.cpp.
References boundingRect(), funcs, QOpenGLFunctions::glDrawArrays(), QT_VERTEX_COORDS_ATTR, setCoords(), staticVertexCoordinateArray, and uploadData().
Referenced by fill(), fillStencilWithVertexArray(), resetClipIfNeeded(), stroke(), and writeClip().
QT_WARNING_PUSH void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs | ( | QFontEngine::GlyphFormat | glyphFormat, |
QStaticTextItem * | staticTextItem | ||
) |
Definition at line 1760 of file qopenglpaintengine.cpp.
References QOpenGL2PEXVertexArray::addQuad(), cache, QOpenGL2PEXVertexArray::clear(), QBrush::color(), QPainter::CompositionMode_Source, QPainter::CompositionMode_SourceOver, QOpenGL2PEXVertexArray::data(), QFontEngine::Format_A32, QFontEngine::Format_ARGB, QTransform::fromScale(), funcs, GL_CONSTANT_COLOR, GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, GLenum(), GLfloat(), GLushort(), QFontEngine::glyphCache(), QFontEngine::glyphMargin(), i, ImageArrayDrawingMode, QOpenGLEngineShaderManager::ImageSrc, QOpenGLEngineShaderManager::ImageTexture, j, QVector2D::length(), QOpenGLTextureGlyphCache::Linear, QOpenGLTextureGlyphCache::Nearest, QStaticTextUserData::OpenGLUserData, QOpenGLEngineShaderManager::PixelMask, Q_ASSERT, qAbs(), qFloor(), qRound(), QT_BRUSH_TEXTURE_UNIT, QT_IMAGE_TEXTURE_UNIT, QT_MASK_TEXTURE_UNIT, qt_premultiplyColor(), QT_TEXTURE_COORDS_ATTR, QT_VERTEX_COORDS_ATTR, QFontEngine::setGlyphCache(), Qt::SolidPattern, QPaintEngineState::state(), QBrush::style(), QOpenGLEngineShaderManager::SubPixelMaskPass1, QOpenGLEngineShaderManager::SubPixelMaskPass2, QFontEngine::subPixelPositionFor(), QFontEngine::supportsSubPixelPositions(), QFontEngine::supportsTransformation(), QFontEngine::supportsVerticalSubPixelPositions(), TextDrawingMode, QTransform::TxRotate, QTransform::TxTranslate, QTransform::type(), QOpenGL2PEXVertexArray::vertexCount(), QPainter::VerticalSubpixelPositioning, Qt::white, and QFixedPoint::y.
void QOpenGL2PaintEngineExPrivate::drawPixmapFragments | ( | const QPainter::PixmapFragment * | fragments, |
int | fragmentCount, | ||
const QPixmap & | pixmap, | ||
QPainter::PixmapFragmentHints | hints | ||
) |
Definition at line 2098 of file qopenglpaintengine.cpp.
References QOpenGL2PEXVertexArray::addVertex(), QOpenGL2PEXVertexArray::clear(), currentBrush, QOpenGLEngineShaderManager::currentProgram(), QOpenGL2PEXVertexArray::data(), QDataBuffer< Type >::data(), funcs, GL_CLAMP_TO_EDGE, QOpenGLFunctions::glDrawArrays(), GLenum(), GLfloat(), QPainter::PixmapFragment::height, i, ImageOpacityArrayDrawingMode, QOpenGLEngineShaderManager::ImageSrc, QOpenGLEngineShaderManager::ImageTexture, matrixDirty, noBrush, QPainter::PixmapFragment::opacity, opacityArray, QPainter::OpaqueHint, QOpenGLEngineShaderManager::PatternColor, QOpenGLEngineShaderManager::PatternSrc, pixmap, prepareForDraw(), qDegreesToRadians(), qFastCos(), qFastSin(), QT_IMAGE_TEXTURE_UNIT, QT_OPACITY_ATTR, qt_premultiplyColor(), QT_TEXTURE_COORDS_ATTR, QT_VERTEX_COORDS_ATTR, QDataBuffer< Type >::reset(), QPainter::PixmapFragment::scaleX, QPainter::PixmapFragment::scaleY, QOpenGLEngineShaderManager::setSrcPixelType(), QOpenGLShaderProgram::setUniformValue(), shaderManager, QDataBuffer< Type >::size(), QPainter::SmoothPixmapTransform, snapToPixelGrid, textureCoordinateArray, transferMode(), updateTexture(), uploadData(), vertexCoordinateArray, QOpenGL2PEXVertexArray::vertexCount(), QPainter::PixmapFragment::width, QPainter::PixmapFragment::x, QOpenGLPoint::x, QPainter::PixmapFragment::y, and QOpenGLPoint::y.
void QOpenGL2PaintEngineExPrivate::drawTexture | ( | const QOpenGLRect & | dest, |
const QOpenGLRect & | src, | ||
const QSize & | textureSize, | ||
bool | opaque, | ||
bool | pattern = false |
||
) |
void QOpenGL2PaintEngineExPrivate::drawVertexArrays | ( | const float * | data, |
int * | stops, | ||
int | stopCount, | ||
GLenum | primitive | ||
) |
Definition at line 1314 of file qopenglpaintengine.cpp.
References funcs, QOpenGLFunctions::glDrawArrays(), i, QT_VERTEX_COORDS_ATTR, and uploadData().
Referenced by fill(), fillStencilWithVertexArray(), and writeClip().
|
inline |
Definition at line 200 of file qopenglpaintengine_p.h.
References QOpenGL2PEXVertexArray::data(), QOpenGL2PEXVertexArray::stopCount(), and QOpenGL2PEXVertexArray::stops().
void QOpenGL2PaintEngineExPrivate::fill | ( | const QVectorPath & | path | ) |
Definition at line 837 of file qopenglpaintengine.cpp.
References QOpenGL2PEXVertexArray::addPath(), QList< T >::at(), QRectF::bottom(), QOpenGL2PEXVertexArray::boundingRect(), BrushDrawingMode, brushUniformsDirty, cache, cleanupVectorPath(), QOpenGL2PEXVertexArray::clear(), composite(), QVarLengthArray< T, Prealloc >::constData(), QOpenGLPaintDevice::context(), currentBrush, QOpenGL2PEXVertexArray::data(), QVertexIndexVector::data(), QVarLengthArray< T, Prealloc >::data(), device, drawVertexArrays(), QOpenGLExtensions::ElementIndexUint, fillStencilWithVertexArray(), QOpenGLContext::format(), funcs, GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, GL_STENCIL_HIGH_BIT, QOpenGLFunctions::glBindBuffer(), QOpenGLFunctions::glBufferData(), QOpenGLFunctions::glDrawArrays(), QOpenGLFunctions::glDrawElements(), GLenum(), QOpenGLFunctions::glGenBuffers(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), QOpenGLExtensions::hasOpenGLExtension(), i, QTriangleSet::indices, inverseScale, QBrush::isOpaque(), QRectF::left(), matrixDirty, prepareForDraw(), Q_ASSERT, QT_VERTEX_COORDS_ATTR, qTriangulate(), qWarning, rect, QVectorPath::RectangleHint, QRectF::right(), QVertexIndexVector::size(), QList< T >::size(), QVLABaseBase::size(), snapToPixelGrid, Qt::SolidPattern, QSurfaceFormat::stencilBufferSize(), QBrush::style(), QRectF::top(), transferMode(), QVertexIndexVector::type(), QVertexIndexVector::UnsignedInt, updateClipScissorTest(), updateMatrix(), uploadData(), uploadIndexData(), vertexCoordinateArray, QOpenGL2PEXVertexArray::vertexCount(), and QTriangleSet::vertices.
void QOpenGL2PaintEngineExPrivate::fillStencilWithVertexArray | ( | const float * | data, |
int | count, | ||
int * | stops, | ||
int | stopCount, | ||
const QOpenGLRect & | bounds, | ||
StencilFillMode | mode | ||
) |
Definition at line 1089 of file qopenglpaintengine.cpp.
References composite(), currentScissorBounds, dirtyStencilRegion, drawVertexArrays(), funcs, GL_DECR_WRAP, GL_INCR_WRAP, GL_STENCIL_HIGH_BIT, QOpenGLFunctions::glClear(), QOpenGLFunctions::glClearStencil(), QOpenGLFunctions::glColorMask(), QOpenGLFunctions::glDrawArrays(), QOpenGLFunctions::glEnable(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), QOpenGLFunctions::glStencilOpSeparate(), QRegion::intersected(), QRegion::intersects(), OddEvenFillMode, Q_ASSERT, QT_VERTEX_COORDS_ATTR, qWarning, rect, setScissor(), stencilClean, updateClipScissorTest(), uploadData(), useSimpleShader(), and WindingFillMode.
Referenced by fill(), stroke(), and writeClip().
|
inline |
Definition at line 209 of file qopenglpaintengine_p.h.
References QOpenGL2PEXVertexArray::boundingRect(), QOpenGL2PEXVertexArray::data(), QOpenGL2PEXVertexArray::stopCount(), and QOpenGL2PEXVertexArray::stops().
|
inlinestatic |
Definition at line 237 of file qopenglpaintengine_p.h.
References engine.
|
inline |
Definition at line 220 of file qopenglpaintengine_p.h.
bool QOpenGL2PaintEngineExPrivate::prepareForCachedGlyphDraw | ( | const QFontEngineGlyphCache & | cache | ) |
Definition at line 1227 of file qopenglpaintengine.cpp.
References cache, prepareForDraw(), Q_ASSERT, ret, QTransform::scale(), and QTransform::TxScale.
bool QOpenGL2PaintEngineExPrivate::prepareForDraw | ( | bool | srcPixelsAreOpaque | ) |
Definition at line 1241 of file qopenglpaintengine.cpp.
References QOpenGLEngineShaderManager::AttributeOpacity, BrushDrawingMode, brushTextureDirty, brushUniformsDirty, QPainter::CompositionMode_Source, QPainter::CompositionMode_SourceOver, compositionModeDirty, currentBrush, QOpenGLEngineShaderManager::currentProgram(), Qt::Dense1Pattern, Qt::DiagCrossPattern, funcs, QOpenGLFunctions::glDisable(), QOpenGLFunctions::glEnable(), GLfloat(), QOpenGLEngineShaderManager::GlobalOpacity, QOpenGLEngineShaderManager::hasComplexGeometry(), ImageArrayDrawingMode, ImageDrawingMode, ImageOpacityArrayDrawingMode, QOpenGLEngineShaderManager::Matrix, matrixDirty, matrixUniformDirty, QOpenGLEngineShaderManager::NoOpacity, opacityUniformDirty, pmvMatrix, QOpenGLEngineShaderManager::setOpacityMode(), QOpenGLShaderProgram::setUniformValue(), shaderManager, Qt::SolidPattern, QBrush::style(), TextDrawingMode, QOpenGLEngineShaderManager::UniformOpacity, updateBrushTexture(), updateBrushUniforms(), updateCompositionMode(), updateMatrix(), and QOpenGLEngineShaderManager::useCorrectShaderProg().
Referenced by drawPixmapFragments(), fill(), prepareForCachedGlyphDraw(), Q_TRACE_INSTRUMENT(), and stroke().
void QOpenGL2PaintEngineExPrivate::regenerateClip | ( | ) |
Definition at line 2565 of file qopenglpaintengine.cpp.
References QPaintEngineExPrivate::replayClipOperations(), and systemStateChanged().
void QOpenGL2PaintEngineExPrivate::resetClipIfNeeded | ( | ) |
Definition at line 1192 of file qopenglpaintengine.cpp.
References QRectF::bottom(), composite(), funcs, GL_STENCIL_HIGH_BIT, QOpenGLFunctions::glColorMask(), QOpenGLFunctions::glEnable(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), QRectF::left(), maxClip, rect, QRectF::right(), QRectF::top(), and useSimpleShader().
void QOpenGL2PaintEngineExPrivate::resetGLState | ( | ) |
Definition at line 726 of file qopenglpaintengine.cpp.
References activateTextureUnit(), QOpenGLContext::currentContext(), funcs, GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, QOpenGLFunctions::glBindBuffer(), QOpenGLFunctions::glClearDepthf(), QOpenGLFunctions::glDepthFunc(), QOpenGLFunctions::glDepthMask(), QOpenGLFunctions::glDisable(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), QOpenGLFunctions::glVertexAttrib4fv(), QOpenGLVertexArrayObject::isCreated(), QT_DEFAULT_TEXTURE_UNIT, QT_OPACITY_ATTR, QT_TEXTURE_COORDS_ATTR, QT_VERTEX_COORDS_ATTR, QOpenGLVertexArrayObject::release(), setVertexAttribArrayEnabled(), and vao.
Definition at line 110 of file qopenglpaintengine.cpp.
References brushTextureDirty, brushUniformsDirty, currentBrush, currentBrushImage, QImage::isNull(), Qt::NoBrush, QOpenGLEngineShaderManager::optimiseForBrushTransform(), Q_ASSERT, qbrush_fast_equals(), qbrush_style(), qHasPixmapTexture(), QOpenGLEngineShaderManager::setSrcPixelType(), shaderManager, Qt::SolidPattern, QBrush::style(), Qt::TexturePattern, QOpenGLEngineShaderManager::TextureSrcWithPattern, QBrush::transform(), and QTransform::type().
Definition at line 2392 of file qopenglpaintengine.cpp.
References device, funcs, QOpenGLFunctions::glScissor(), QOpenGLPaintDevice::paintFlipped(), and rect.
Referenced by fillStencilWithVertexArray(), and updateClipScissorTest().
void QOpenGL2PaintEngineExPrivate::setVertexAttribArrayEnabled | ( | int | arrayIndex, |
bool | enabled = true |
||
) |
Definition at line 2706 of file qopenglpaintengine.cpp.
References enabled, funcs, QOpenGLFunctions::glDisableVertexAttribArray(), QOpenGLFunctions::glEnableVertexAttribArray(), Q_ASSERT, QT_GL_VERTEX_ARRAY_TRACKED_COUNT, and vertexAttributeArraysEnabledState.
Referenced by Q_TRACE_INSTRUMENT(), and resetGLState().
|
inlinestatic |
Definition at line 236 of file qopenglpaintengine_p.h.
References engine.
Referenced by QOpenGLCustomShaderStage::removeFromPainter(), and QOpenGLCustomShaderStage::setOnPainter().
void QOpenGL2PaintEngineExPrivate::stroke | ( | const QVectorPath & | path, |
const QPen & | pen | ||
) |
Definition at line 1375 of file qopenglpaintengine.cpp.
References QRectF::adjusted(), BrushDrawingMode, composite(), dasher, QDashedStrokeProcessor::elementCount(), QDashedStrokeProcessor::elementTypes(), fillStencilWithVertexArray(), funcs, GL_STENCIL_HIGH_BIT, QOpenGLFunctions::glDrawArrays(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), inverseScale, QPen::isCosmetic(), QBrush::isOpaque(), QPen::joinStyle(), matrixDirty, Qt::MiterJoin, QPen::miterLimit(), QDashedStrokeProcessor::points(), prepareForDraw(), QTriangulatingStroker::process(), QDashedStrokeProcessor::process(), qMax(), qpen_brush(), qpen_style(), qpen_widthf(), QT_VERTEX_COORDS_ATTR, snapToPixelGrid, Qt::SolidLine, QPaintEngineState::state(), stroker, transferMode(), TriStripStrokeFillMode, updateClipScissorTest(), updateMatrix(), uploadData(), QTriangulatingStroker::vertexCount(), QTriangulatingStroker::vertices(), and width.
void QOpenGL2PaintEngineExPrivate::syncGlState | ( | ) |
Definition at line 2719 of file qopenglpaintengine.cpp.
References funcs, QOpenGLFunctions::glDisableVertexAttribArray(), QOpenGLFunctions::glEnableVertexAttribArray(), i, QT_GL_VERTEX_ARRAY_TRACKED_COUNT, and vertexAttributeArraysEnabledState.
|
overridevirtual |
Reimplemented from QPaintEnginePrivate.
Definition at line 2571 of file qopenglpaintengine.cpp.
References QRegion::boundingRect(), clearClip(), QPaintEnginePrivate::currentClipDevice, QRegion::isEmpty(), maxClip, qtVectorPathForPath(), QRegion::rectCount(), QPaintEnginePrivate::systemClip, updateClipScissorTest(), useSystemClip, QInternal::Widget, and writeClip().
Referenced by regenerateClip().
void QOpenGL2PaintEngineExPrivate::transferMode | ( | EngineMode | newMode | ) |
Definition at line 773 of file qopenglpaintengine.cpp.
References QOpenGL2PEXVertexArray::data(), QDataBuffer< Type >::data(), GLfloat(), ImageArrayDrawingMode, ImageDrawingMode, ImageOpacityArrayDrawingMode, QOpenGLEngineShaderManager::NoMask, opacityArray, QT_OPACITY_ATTR, QT_TEXTURE_COORDS_ATTR, QT_VERTEX_COORDS_ATTR, QOpenGLEngineShaderManager::setHasComplexGeometry(), QOpenGLEngineShaderManager::setMaskType(), shaderManager, QDataBuffer< Type >::size(), staticTextureCoordinateArray, staticVertexCoordinateArray, TextDrawingMode, textureCoordinateArray, uploadData(), vertexCoordinateArray, and QOpenGL2PEXVertexArray::vertexCount().
Referenced by drawPixmapFragments(), fill(), QOpenGLTextureGlyphCache::resizeTextureData(), stroke(), and writeClip().
void QOpenGL2PaintEngineExPrivate::updateBrushTexture | ( | ) |
Definition at line 265 of file qopenglpaintengine.cpp.
References QSize::boundedTo(), brushTextureDirty, QGradient::ConicalGradient, Qt::ConicalGradientPattern, currentBrush, currentBrushImage, QOpenGLContext::currentContext(), Qt::Dense1Pattern, Qt::DiagCrossPattern, ForceUpdate, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, GLenum(), GLuint, QBrush::gradient(), QSize::height(), Qt::IgnoreAspectRatio, isPowerOfTwo(), Qt::LinearGradientPattern, QOpenGLFunctions::NPOTTextureRepeat, qNextPowerOfTwo(), QT_BRUSH_TEXTURE_UNIT, qt_imageForBrush(), QGradient::ReflectSpread, QGradient::RepeatSpread, QImage::scaled(), QSize::setHeight(), QSize::setWidth(), QImage::size(), QPainter::SmoothPixmapTransform, Qt::SmoothTransformation, QGradient::spread(), QBrush::style(), QBrush::textureImage(), Qt::TexturePattern, QGradient::type(), updateTexture(), and QSize::width().
Referenced by prepareForDraw().
void QOpenGL2PaintEngineExPrivate::updateBrushUniforms | ( | ) |
Definition at line 316 of file qopenglpaintengine.cpp.
References QOpenGLEngineShaderManager::Angle, QOpenGLEngineShaderManager::BRadius, QOpenGLEngineShaderManager::BrushTexture, QOpenGLEngineShaderManager::BrushTransform, brushUniformsDirty, QBrush::color(), Qt::ConicalGradientPattern, currentBrush, QOpenGLEngineShaderManager::currentProgram(), device, Qt::DiagCrossPattern, QOpenGLEngineShaderManager::Fmp, fmp, QOpenGLEngineShaderManager::Fmp2MRadius2, QOpenGLEngineShaderManager::FragmentColor, GLfloat(), QBrush::gradient(), QOpenGLEngineShaderManager::HalfViewportSize, halfViewportSize, QPixmap::height(), height, QOpenGLEngineShaderManager::Inverse2Fmp2MRadius2, QTransform::inverted(), QOpenGLEngineShaderManager::InvertedTextureSize, QPixmap::isQBitmap(), QOpenGLEngineShaderManager::LinearData, Qt::LinearGradientPattern, Qt::NoBrush, QPainter::NonCosmeticBrushPatterns, QOpenGLPaintDevice::paintFlipped(), QOpenGLEngineShaderManager::PatternColor, qDegreesToRadians(), qHasPixmapTexture(), QT_BRUSH_TEXTURE_UNIT, qt_premultiplyColor(), qWarning, Qt::RadialGradientPattern, QOpenGLShaderProgram::setUniformValue(), shaderManager, Qt::SolidPattern, QOpenGLEngineShaderManager::SqrFr, QBrush::style(), QBrush::texture(), Qt::TexturePattern, QBrush::transform(), translate(), QPixmap::width(), QPointF::x(), and QPointF::y().
Referenced by prepareForDraw().
void QOpenGL2PaintEngineExPrivate::updateClipScissorTest | ( | ) |
Definition at line 2350 of file qopenglpaintengine.cpp.
References QRegion::boundingRect(), currentScissorBounds, funcs, GL_STENCIL_HIGH_BIT, QOpenGLFunctions::glDisable(), QOpenGLFunctions::glEnable(), QOpenGLFunctions::glStencilFunc(), QRect::intersected(), qWarning, setScissor(), QPaintEnginePrivate::systemClip, and useSystemClip.
Referenced by fill(), fillStencilWithVertexArray(), QOpenGLTextureGlyphCache::resizeTextureData(), stroke(), and systemStateChanged().
void QOpenGL2PaintEngineExPrivate::updateCompositionMode | ( | ) |
Definition at line 514 of file qopenglpaintengine.cpp.
References QOpenGLFunctions::BlendEquationAdvanced, QPainter::CompositionMode_Clear, QPainter::CompositionMode_ColorBurn, QPainter::CompositionMode_ColorDodge, QPainter::CompositionMode_Darken, QPainter::CompositionMode_Destination, QPainter::CompositionMode_DestinationAtop, QPainter::CompositionMode_DestinationIn, QPainter::CompositionMode_DestinationOut, QPainter::CompositionMode_DestinationOver, QPainter::CompositionMode_Difference, QPainter::CompositionMode_Exclusion, QPainter::CompositionMode_HardLight, QPainter::CompositionMode_Lighten, QPainter::CompositionMode_Multiply, QPainter::CompositionMode_Overlay, QPainter::CompositionMode_Plus, QPainter::CompositionMode_Screen, QPainter::CompositionMode_SoftLight, QPainter::CompositionMode_Source, QPainter::CompositionMode_SourceAtop, QPainter::CompositionMode_SourceIn, QPainter::CompositionMode_SourceOut, QPainter::CompositionMode_SourceOver, QPainter::CompositionMode_Xor, compositionModeDirty, funcs, GL_BLEND_ADVANCED_COHERENT_KHR, GL_COLORBURN_KHR, GL_COLORDODGE_KHR, GL_DARKEN_KHR, GL_DIFFERENCE_KHR, GL_EXCLUSION_KHR, GL_FUNC_ADD, GL_HARDLIGHT_KHR, GL_LIGHTEN_KHR, GL_MULTIPLY_KHR, GL_OVERLAY_KHR, GL_SCREEN_KHR, GL_SOFTLIGHT_KHR, QOpenGLFunctions::glBlendEquation(), QOpenGLFunctions::glBlendFunc(), QOpenGLFunctions::glDisable(), QOpenGLFunctions::glEnable(), qWarning, QOpenGLEngineShaderManager::setCompositionMode(), and shaderManager.
Referenced by prepareForDraw().
void QOpenGL2PaintEngineExPrivate::updateMatrix | ( | ) |
Definition at line 443 of file qopenglpaintengine.cpp.
References dasher, device, funcs, GLfloat(), QOpenGLFunctions::glVertexAttrib3fv(), height, inverseScale, matrixDirty, matrixUniformDirty, QOpenGLPaintDevice::paintFlipped(), pmvMatrix, qAbs(), qMax(), QT_PMV_MATRIX_1_ATTR, QT_PMV_MATRIX_2_ATTR, QT_PMV_MATRIX_3_ATTR, QTriangulatingStroker::setInvScale(), QDashedStrokeProcessor::setInvScale(), snapToPixelGrid, stroker, QTransform::TxTranslate, and width.
Referenced by fill(), prepareForDraw(), stroke(), useSimpleShader(), and writeClip().
void QOpenGL2PaintEngineExPrivate::updateTexture | ( | GLenum | textureUnit, |
const T & | texture, | ||
GLenum | wrapMode, | ||
GLenum | filterMode, | ||
TextureUpdateMode | updateMode = UpdateIfNeeded |
||
) |
Definition at line 160 of file qopenglpaintengine.cpp.
References activateTextureUnit(), bindTexture(), funcs, GLenum(), QOpenGLFunctions::glTexParameteri(), GLuint, lastTextureUsed, and UpdateIfNeeded.
Referenced by drawPixmapFragments(), and updateBrushTexture().
|
inline |
Definition at line 306 of file qopenglpaintengine_p.h.
References funcs, GL_FLOAT, Q_ASSERT, QT_OPACITY_ATTR, QT_TEXTURE_COORDS_ATTR, and QT_VERTEX_COORDS_ATTR.
Referenced by composite(), drawPixmapFragments(), drawVertexArrays(), fill(), fillStencilWithVertexArray(), Q_TRACE_INSTRUMENT(), QOpenGLTextureGlyphCache::resizeTextureData(), stroke(), and transferMode().
|
inline |
Definition at line 328 of file qopenglpaintengine_p.h.
References Q_ASSERT.
Referenced by fill().
|
inline |
Definition at line 137 of file qopenglpaintengine.cpp.
References matrixDirty, shaderManager, updateMatrix(), and QOpenGLEngineShaderManager::useSimpleProgram().
Referenced by fillStencilWithVertexArray(), resetClipIfNeeded(), and writeClip().
void QOpenGL2PaintEngineExPrivate::writeClip | ( | const QVectorPath & | path, |
uint | value | ||
) |
Definition at line 2429 of file qopenglpaintengine.cpp.
References QOpenGL2PEXVertexArray::addPath(), QOpenGL2PEXVertexArray::boundingRect(), BrushDrawingMode, QOpenGL2PEXVertexArray::clear(), clearClip(), composite(), drawVertexArrays(), fillStencilWithVertexArray(), funcs, GL_STENCIL_HIGH_BIT, QOpenGLFunctions::glColorMask(), QOpenGLFunctions::glEnable(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), inverseScale, matrixDirty, maxClip, snapToPixelGrid, stencilClean, transferMode(), updateMatrix(), useSimpleShader(), and vertexCoordinateArray.
Referenced by systemStateChanged().
bool QOpenGL2PaintEngineExPrivate::brushTextureDirty |
Definition at line 255 of file qopenglpaintengine_p.h.
Referenced by prepareForDraw(), setBrush(), and updateBrushTexture().
bool QOpenGL2PaintEngineExPrivate::brushUniformsDirty |
Definition at line 256 of file qopenglpaintengine_p.h.
Referenced by fill(), prepareForDraw(), setBrush(), and updateBrushUniforms().
bool QOpenGL2PaintEngineExPrivate::compositionModeDirty |
Definition at line 254 of file qopenglpaintengine_p.h.
Referenced by prepareForDraw(), and updateCompositionMode().
QOpenGLContext* QOpenGL2PaintEngineExPrivate::ctx |
Definition at line 246 of file qopenglpaintengine_p.h.
QBrush QOpenGL2PaintEngineExPrivate::currentBrush |
Definition at line 266 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), fill(), prepareForDraw(), Q_TRACE_INSTRUMENT(), setBrush(), updateBrushTexture(), and updateBrushUniforms().
QImage QOpenGL2PaintEngineExPrivate::currentBrushImage |
Definition at line 269 of file qopenglpaintengine_p.h.
Referenced by setBrush(), and updateBrushTexture().
QRect QOpenGL2PaintEngineExPrivate::currentScissorBounds |
Definition at line 263 of file qopenglpaintengine_p.h.
Referenced by clearClip(), fillStencilWithVertexArray(), and updateClipScissorTest().
QDashedStrokeProcessor QOpenGL2PaintEngineExPrivate::dasher |
Definition at line 297 of file qopenglpaintengine_p.h.
Referenced by stroke(), and updateMatrix().
QOpenGLPaintDevice* QOpenGL2PaintEngineExPrivate::device |
Definition at line 244 of file qopenglpaintengine_p.h.
Referenced by fill(), setScissor(), updateBrushUniforms(), and updateMatrix().
QRegion QOpenGL2PaintEngineExPrivate::dirtyStencilRegion |
Definition at line 262 of file qopenglpaintengine_p.h.
Referenced by clearClip(), and fillStencilWithVertexArray().
Definition at line 273 of file qopenglpaintengine_p.h.
GLuint QOpenGL2PaintEngineExPrivate::elementIndicesVBOId |
Definition at line 274 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate().
QOpenGLExtensions QOpenGL2PaintEngineExPrivate::funcs |
Definition at line 240 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate(), activateTextureUnit(), bindTexture(), clearClip(), composite(), drawPixmapFragments(), drawVertexArrays(), fill(), fillStencilWithVertexArray(), prepareForDraw(), Q_TRACE_INSTRUMENT(), resetClipIfNeeded(), resetGLState(), setScissor(), setVertexAttribArrayEnabled(), stroke(), syncGlState(), updateClipScissorTest(), updateCompositionMode(), updateMatrix(), updateTexture(), and writeClip().
QFontEngine::GlyphFormat QOpenGL2PaintEngineExPrivate::glyphCacheFormat |
Definition at line 248 of file qopenglpaintengine_p.h.
int QOpenGL2PaintEngineExPrivate::height |
Definition at line 245 of file qopenglpaintengine_p.h.
Referenced by QOpenGLTextureGlyphCache::resizeTextureData(), updateBrushUniforms(), and updateMatrix().
QOpenGLBuffer QOpenGL2PaintEngineExPrivate::indexBuffer |
Definition at line 291 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate().
GLfloat QOpenGL2PaintEngineExPrivate::inverseScale |
Definition at line 282 of file qopenglpaintengine_p.h.
Referenced by fill(), stroke(), updateMatrix(), and writeClip().
GLenum QOpenGL2PaintEngineExPrivate::lastTextureUnitUsed |
Definition at line 284 of file qopenglpaintengine_p.h.
Referenced by activateTextureUnit().
GLuint QOpenGL2PaintEngineExPrivate::lastTextureUsed |
Definition at line 285 of file qopenglpaintengine_p.h.
Referenced by activateTextureUnit(), bindTexture(), and updateTexture().
bool QOpenGL2PaintEngineExPrivate::matrixDirty |
Definition at line 253 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), fill(), prepareForDraw(), Q_TRACE_INSTRUMENT(), stroke(), updateMatrix(), useSimpleShader(), and writeClip().
bool QOpenGL2PaintEngineExPrivate::matrixUniformDirty |
Definition at line 258 of file qopenglpaintengine_p.h.
Referenced by prepareForDraw(), and updateMatrix().
uint QOpenGL2PaintEngineExPrivate::maxClip |
Definition at line 264 of file qopenglpaintengine_p.h.
Referenced by resetClipIfNeeded(), systemStateChanged(), and writeClip().
EngineMode QOpenGL2PaintEngineExPrivate::mode |
Definition at line 247 of file qopenglpaintengine_p.h.
bool QOpenGL2PaintEngineExPrivate::multisamplingAlwaysEnabled |
Definition at line 294 of file qopenglpaintengine_p.h.
bool QOpenGL2PaintEngineExPrivate::nativePaintingActive |
Definition at line 280 of file qopenglpaintengine_p.h.
bool QOpenGL2PaintEngineExPrivate::needsSync |
Definition at line 293 of file qopenglpaintengine_p.h.
const QBrush QOpenGL2PaintEngineExPrivate::noBrush |
Definition at line 267 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), and Q_TRACE_INSTRUMENT().
QDataBuffer<GLfloat> QOpenGL2PaintEngineExPrivate::opacityArray |
Definition at line 275 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), and transferMode().
QOpenGLBuffer QOpenGL2PaintEngineExPrivate::opacityBuffer |
Definition at line 290 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate().
bool QOpenGL2PaintEngineExPrivate::opacityUniformDirty |
Definition at line 257 of file qopenglpaintengine_p.h.
Referenced by prepareForDraw().
GLfloat QOpenGL2PaintEngineExPrivate::pmvMatrix[3][3] |
Definition at line 281 of file qopenglpaintengine_p.h.
Referenced by prepareForDraw(), and updateMatrix().
QOpenGL2PaintEngineEx* QOpenGL2PaintEngineExPrivate::q |
Definition at line 242 of file qopenglpaintengine_p.h.
QOpenGLEngineShaderManager* QOpenGL2PaintEngineExPrivate::shaderManager |
Definition at line 243 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate(), drawPixmapFragments(), prepareForDraw(), Q_TRACE_INSTRUMENT(), QOpenGLTextureGlyphCache::resizeTextureData(), setBrush(), transferMode(), updateBrushUniforms(), updateCompositionMode(), and useSimpleShader().
bool QOpenGL2PaintEngineExPrivate::snapToPixelGrid |
Definition at line 279 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), fill(), Q_TRACE_INSTRUMENT(), stroke(), updateMatrix(), and writeClip().
GLfloat QOpenGL2PaintEngineExPrivate::staticTextureCoordinateArray[8] |
Definition at line 277 of file qopenglpaintengine_p.h.
Referenced by Q_TRACE_INSTRUMENT(), and transferMode().
GLfloat QOpenGL2PaintEngineExPrivate::staticVertexCoordinateArray[8] |
Definition at line 276 of file qopenglpaintengine_p.h.
Referenced by composite(), Q_TRACE_INSTRUMENT(), and transferMode().
bool QOpenGL2PaintEngineExPrivate::stencilClean |
Definition at line 260 of file qopenglpaintengine_p.h.
Referenced by fillStencilWithVertexArray(), and writeClip().
QTriangulatingStroker QOpenGL2PaintEngineExPrivate::stroker |
Definition at line 296 of file qopenglpaintengine_p.h.
Referenced by stroke(), and updateMatrix().
QOpenGLBuffer QOpenGL2PaintEngineExPrivate::texCoordBuffer |
Definition at line 289 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate().
QOpenGL2PEXVertexArray QOpenGL2PaintEngineExPrivate::textureCoordinateArray |
Definition at line 272 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), and transferMode().
QVarLengthArray<GLuint, 8> QOpenGL2PaintEngineExPrivate::unusedIBOSToClean |
Definition at line 300 of file qopenglpaintengine_p.h.
QVarLengthArray<GLuint, 8> QOpenGL2PaintEngineExPrivate::unusedVBOSToClean |
Definition at line 299 of file qopenglpaintengine_p.h.
bool QOpenGL2PaintEngineExPrivate::useSystemClip |
Definition at line 261 of file qopenglpaintengine_p.h.
Referenced by systemStateChanged(), and updateClipScissorTest().
QOpenGLVertexArrayObject QOpenGL2PaintEngineExPrivate::vao |
Definition at line 287 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate(), and resetGLState().
const GLfloat* QOpenGL2PaintEngineExPrivate::vertexAttribPointers[3] |
Definition at line 302 of file qopenglpaintengine_p.h.
bool QOpenGL2PaintEngineExPrivate::vertexAttributeArraysEnabledState[QT_GL_VERTEX_ARRAY_TRACKED_COUNT] |
Definition at line 250 of file qopenglpaintengine_p.h.
Referenced by setVertexAttribArrayEnabled(), and syncGlState().
QOpenGLBuffer QOpenGL2PaintEngineExPrivate::vertexBuffer |
Definition at line 288 of file qopenglpaintengine_p.h.
Referenced by ~QOpenGL2PaintEngineExPrivate().
QOpenGL2PEXVertexArray QOpenGL2PaintEngineExPrivate::vertexCoordinateArray |
Definition at line 271 of file qopenglpaintengine_p.h.
Referenced by drawPixmapFragments(), fill(), transferMode(), and writeClip().
int QOpenGL2PaintEngineExPrivate::width |
Definition at line 245 of file qopenglpaintengine_p.h.
Referenced by QOpenGLTextureGlyphCache::resizeTextureData(), stroke(), and updateMatrix().