diff options
Diffstat (limited to 'src/quick/items/qquickpainteditem.cpp')
-rw-r--r-- | src/quick/items/qquickpainteditem.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index d363fbcd31..df4ee6014d 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -8,7 +8,7 @@ #include <QtQuick/private/qsgcontext_p.h> #include <private/qsgadaptationlayer_p.h> #include <qsgtextureprovider.h> -#include <QtGui/private/qrhi_p.h> +#include <rhi/qrhi.h> #include <qmath.h> @@ -87,7 +87,6 @@ QQuickPaintedItemPrivate::QQuickPaintedItemPrivate() , fillColor(Qt::transparent) , renderTarget(QQuickPaintedItem::Image) , opaquePainting(false) - , antialiasing(false) , mipmap(false) , textureProvider(nullptr) , node(nullptr) @@ -177,6 +176,7 @@ void QQuickPaintedItem::setOpaquePainting(bool opaque) QQuickItem::update(); } +//### Qt7: remove the aa functions; they shadow the QQuickItem property /*! Returns true if antialiased painting is enabled; otherwise, false is returned. @@ -186,8 +186,7 @@ void QQuickPaintedItem::setOpaquePainting(bool opaque) */ bool QQuickPaintedItem::antialiasing() const { - Q_D(const QQuickPaintedItem); - return d->antialiasing; + return QQuickItem::antialiasing(); } /*! @@ -199,13 +198,7 @@ bool QQuickPaintedItem::antialiasing() const */ void QQuickPaintedItem::setAntialiasing(bool enable) { - Q_D(QQuickPaintedItem); - - if (d->antialiasing == enable) - return; - - d->antialiasing = enable; - update(); + QQuickItem::setAntialiasing(enable); } /*! @@ -416,6 +409,10 @@ void QQuickPaintedItem::setContentsScale(qreal scale) \brief The item's background fill color. By default, the fill color is set to Qt::transparent. + + Set the fill color to an invalid color (e.g. QColor()) to disable background + filling. This may improve performance, and is safe to do if the paint() function + draws to all pixels on each frame. */ QColor QQuickPaintedItem::fillColor() const { @@ -546,7 +543,7 @@ QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat node->setPreferredRenderTarget(d->renderTarget); node->setFastFBOResizing(d->performanceHints & FastFBOResizing); - node->setSmoothPainting(d->antialiasing); + node->setSmoothPainting(antialiasing()); node->setLinearFiltering(d->smooth); node->setMipmapping(d->mipmap); node->setOpaquePainting(d->opaquePainting); |