6#include <private/qsgcontext_p.h>
9#include <QtGui/QPainter>
17 , m_dirtyContents(
false)
18 , m_opaquePainting(
false)
19 , m_linear_filtering(
false)
20 , m_smoothPainting(
false)
21 , m_fillColor(
Qt::transparent)
22 , m_contentsScale(1.0)
23 , m_dirtyGeometry(
false)
46 m_dirtyGeometry =
true;
51 m_dirtyContents =
true;
52 m_dirtyRect = dirtyRect;
58 if (opaque == m_opaquePainting)
61 m_opaquePainting = opaque;
66 if (linearFiltering == m_linear_filtering)
69 m_linear_filtering = linearFiltering;
79 if (
s == m_smoothPainting)
96 if (
s == m_contentsScale)
109 if (
size == m_textureSize)
112 m_textureSize =
size;
113 m_dirtyGeometry =
true;
123 if (m_dirtyGeometry) {
124 if (!m_opaquePainting)
133 m_dirtyGeometry =
false;
134 m_dirtyContents =
false;
151 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
153 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
156 if (m_linear_filtering)
157 vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_BETTER);
159 vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_NONANTIALIASED);
162 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
165 vgDrawImage(
static_cast<VGImage
>(m_texture->
comparisonKey()));
175 if (m_smoothPainting) {
181 if (m_contentsScale == 1) {
185 clipRect = dirtyRect;
190 qFloor(dirtyRect.
y()/m_contentsScale),
191 qCeil(dirtyRect.
width()/m_contentsScale+dirtyRect.
x()/m_contentsScale-
qFloor(dirtyRect.
x()/m_contentsScale)),
192 qCeil(dirtyRect.
height()/m_contentsScale+dirtyRect.
y()/m_contentsScale-
qFloor(dirtyRect.
y()/m_contentsScale)));
197 if (!m_dirtyRect.
isNull())
207 m_dirtyRect =
QRect();
The QColor class provides colors based on RGB, HSV or CMYK values.
@ Format_ARGB32_Premultiplied
The QPainter class performs low-level painting on widgets and other paint devices.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false.
void scale(qreal sx, qreal sy)
Scales the coordinate system by ({sx}, {sy}).
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
@ CompositionMode_SourceOver
void setRenderHints(RenderHints hints, bool on=true)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
The QQuickPaintedItem class provides a way to use the QPainter API in the QML Scene Graph.
virtual void paint(QPainter *painter)=0
This function, which is usually called by the QML Scene Graph, paints the contents of an item in loca...
RenderTarget
This enum describes QQuickPaintedItem's render targets.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
The QSGMaterial class encapsulates rendering state for a shader program.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
void setTextureSize(const QSize &size) override
QSGTexture * texture() const override
void setFillColor(const QColor &c) override
void setOpaquePainting(bool opaque) override
void setDirty(const QRect &dirtyRect) override
void setMipmapping(bool mipmapping) override
void setSmoothPainting(bool s) override
void setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) override
void setLinearFiltering(bool linearFiltering) override
void setContentsScale(qreal s) override
QImage toImage() const override
void setSize(const QSize &size) override
QSGOpenVGPainterNode(QQuickPaintedItem *item)
void setFastFBOResizing(bool dynamic) override
VGPaint opacityPaint() const
const QOpenVGMatrix & transform() const
qint64 comparisonKey() const override
Returns a key suitable for comparing textures.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]