diff options
Diffstat (limited to 'src/gui/painting')
23 files changed, 83 insertions, 98 deletions
diff --git a/src/gui/painting/qbackingstoredefaultcompositor.cpp b/src/gui/painting/qbackingstoredefaultcompositor.cpp index 913afed846..076ae3e984 100644 --- a/src/gui/painting/qbackingstoredefaultcompositor.cpp +++ b/src/gui/painting/qbackingstoredefaultcompositor.cpp @@ -148,7 +148,7 @@ static QRegion scaledRegion(const QRegion ®ion, qreal factor, const QPoint &o rects.append(scaledRect(rect.translated(offset), factor)); QRegion deviceRegion; - deviceRegion.setRects(rects.constData(), rects.count()); + deviceRegion.setRects(rects.constData(), rects.size()); return deviceRegion; } @@ -508,8 +508,7 @@ QPlatformBackingStore::FlushResult QBackingStoreDefaultCompositor::flush(QPlatfo if (m_texture) { // The backingstore is for the entire tlw. // In case of native children offset tells the position relative to the tlw. - const QRect textureRect = QRect(QPoint(), m_texture->pixelSize()); - const QRect srcRect = toBottomLeftRect(textureRect.translated(deviceWindowOffset), m_texture->pixelSize().height()); + const QRect srcRect = toBottomLeftRect(deviceWindowRect.translated(deviceWindowOffset), m_texture->pixelSize().height()); const QMatrix3x3 source = sourceTransform(srcRect, m_texture->pixelSize(), origin); QMatrix4x4 target; // identity if (invertTargetY) @@ -518,7 +517,7 @@ QPlatformBackingStore::FlushResult QBackingStoreDefaultCompositor::flush(QPlatfo } const int textureWidgetCount = textures->count(); - const int oldTextureQuadDataCount = m_textureQuadData.count(); + const int oldTextureQuadDataCount = m_textureQuadData.size(); if (oldTextureQuadDataCount != textureWidgetCount) { for (int i = textureWidgetCount; i < oldTextureQuadDataCount; ++i) m_textureQuadData[i].reset(); diff --git a/src/gui/painting/qbackingstorerhisupport.cpp b/src/gui/painting/qbackingstorerhisupport.cpp index 81b3f0eb7d..9a59db5f77 100644 --- a/src/gui/painting/qbackingstorerhisupport.cpp +++ b/src/gui/painting/qbackingstorerhisupport.cpp @@ -116,7 +116,6 @@ bool QBackingStoreRhiSupport::create() return false; } params.window = m_window; - params.deviceExtensions = m_config.deviceExtensions(); rhi = QRhi::create(QRhi::Vulkan, ¶ms, flags); } #endif diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index 420e44b086..2d6db1a14c 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -270,7 +270,6 @@ public: // can't give friendship to a namespace, so it needs to be public }; Q_DECLARE_TYPEINFO(QColor, Q_RELOCATABLE_TYPE); -#if QT_DEPRECATED_SINCE(6, 6) inline QColor::QColor(QLatin1StringView aname) : QColor(fromString(aname)) {} @@ -282,7 +281,6 @@ inline QColor::QColor(const QString& aname) inline QColor::QColor(const char *aname) : QColor(fromString(aname)) {} -#endif inline bool QColor::isValid() const noexcept { return cspec != Invalid; } diff --git a/src/gui/painting/qcolortransfertable_p.h b/src/gui/painting/qcolortransfertable_p.h index 4563acf1fa..dc0f5804fd 100644 --- a/src/gui/painting/qcolortransfertable_p.h +++ b/src/gui/painting/qcolortransfertable_p.h @@ -35,12 +35,12 @@ public: QColorTransferTable(uint32_t size, const QList<uint8_t> &table) noexcept : m_tableSize(size), m_table8(table) { - Q_ASSERT(qsizetype(size) <= table.count()); + Q_ASSERT(qsizetype(size) <= table.size()); } QColorTransferTable(uint32_t size, const QList<uint16_t> &table) noexcept : m_tableSize(size), m_table16(table) { - Q_ASSERT(qsizetype(size) <= table.count()); + Q_ASSERT(qsizetype(size) <= table.size()); } bool isEmpty() const diff --git a/src/gui/painting/qcolortrclut_p.h b/src/gui/painting/qcolortrclut_p.h index 1b312d4a78..c6b73d9f69 100644 --- a/src/gui/painting/qcolortrclut_p.h +++ b/src/gui/painting/qcolortrclut_p.h @@ -82,6 +82,7 @@ public: return QRgba64::fromRgba64(r, g, b, qAlpha(rgb32) * 257); #endif } + QRgba64 toLinear64(QRgba64) const = delete; QRgb toLinear(QRgb rgb32) const { diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index ed44efc5ec..b03ebe55e6 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -132,7 +132,7 @@ QT_END_NAMESPACE auto nsImage = [[[NSImage alloc] initWithSize:NSZeroSize] autorelease]; - for (QSize size : qAsConst(availableSizes)) { + for (QSize size : std::as_const(availableSizes)) { QImage image = icon.pixmap(size).toImage(); if (image.isNull()) continue; diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 35c44b8286..89db5b9bcd 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -32,6 +32,7 @@ #if defined(QT_USE_THREAD_PARALLEL_FILLS) #include <qsemaphore.h> #include <qthreadpool.h> +#include <private/qthreadpool_p.h> #endif QT_BEGIN_NAMESPACE @@ -3778,7 +3779,7 @@ static void spanfill_from_first(QRasterBuffer *rasterBuffer, QPixelLayout::BPP b #if defined(QT_USE_THREAD_PARALLEL_FILLS) #define QT_THREAD_PARALLEL_FILLS(function) \ const int segments = (count + 32) / 64; \ - QThreadPool *threadPool = QThreadPool::globalInstance(); \ + QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance(); \ if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { \ QSemaphore semaphore; \ int c = 0; \ @@ -3787,7 +3788,7 @@ static void spanfill_from_first(QRasterBuffer *rasterBuffer, QPixelLayout::BPP b threadPool->start([&, c, cn]() { \ function(c, c + cn); \ semaphore.release(1); \ - }); \ + }, 1); \ c += cn; \ } \ semaphore.acquire(segments); \ @@ -5615,7 +5616,7 @@ static inline void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba static inline void rgbBlendPixel(QRgba64 &dst, int coverage, QRgba64 slinear, const QColorTrcLut *colorProfile) { // Do a gammacorrected RGB alphablend... - const QRgba64 dlinear = colorProfile ? colorProfile->toLinear64(dst) : dst; + const QRgba64 dlinear = colorProfile ? colorProfile->toLinear(dst) : dst; QRgba64 blend = rgbBlend(dlinear, slinear, coverage); diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp index 80d1a67a3f..a636635fd5 100644 --- a/src/gui/painting/qimagescale.cpp +++ b/src/gui/painting/qimagescale.cpp @@ -10,8 +10,9 @@ #include "qrgbafloat.h" #if QT_CONFIG(thread) && !defined(Q_OS_WASM) -#include "qsemaphore.h" -#include "qthreadpool.h" +#include <qsemaphore.h> +#include <qthreadpool.h> +#include <private/qthreadpool_p.h> #endif QT_BEGIN_NAMESPACE @@ -273,7 +274,7 @@ static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, con #if QT_CONFIG(thread) && !defined(Q_OS_WASM) int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16); segments = std::min(segments, dh); - QThreadPool *threadPool = QThreadPool::globalInstance(); + QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance(); if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { QSemaphore semaphore; int y = 0; diff --git a/src/gui/painting/qimagescale_neon.cpp b/src/gui/painting/qimagescale_neon.cpp index c8d364d56c..074b819862 100644 --- a/src/gui/painting/qimagescale_neon.cpp +++ b/src/gui/painting/qimagescale_neon.cpp @@ -6,8 +6,9 @@ #include <private/qsimd_p.h> #if QT_CONFIG(thread) && !defined(Q_OS_WASM) -#include "qsemaphore.h" -#include "qthreadpool.h" +#include <qsemaphore.h> +#include <qthreadpool.h> +#include <private/qthreadpool_p.h> #endif #if defined(__ARM_NEON__) @@ -22,7 +23,7 @@ static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, con #if QT_CONFIG(thread) && !defined(Q_OS_WASM) int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16); segments = std::min(segments, dh); - QThreadPool *threadPool = QThreadPool::globalInstance(); + QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance(); if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { QSemaphore semaphore; int y = 0; diff --git a/src/gui/painting/qimagescale_sse4.cpp b/src/gui/painting/qimagescale_sse4.cpp index f55290b46c..982e533a32 100644 --- a/src/gui/painting/qimagescale_sse4.cpp +++ b/src/gui/painting/qimagescale_sse4.cpp @@ -7,8 +7,9 @@ #include <private/qsimd_p.h> #if QT_CONFIG(thread) && !defined(Q_OS_WASM) -#include "qsemaphore.h" -#include "qthreadpool.h" +#include <qsemaphore.h> +#include <qthreadpool.h> +#include <private/qthreadpool_p.h> #endif #if defined(QT_COMPILER_SUPPORTS_SSE4_1) @@ -23,7 +24,7 @@ static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, con #if QT_CONFIG(thread) && !defined(Q_OS_WASM) int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16); segments = std::min(segments, dh); - QThreadPool *threadPool = QThreadPool::globalInstance(); + QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance(); if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { QSemaphore semaphore; int y = 0; diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp index 0dfb310ee9..93eac5cced 100644 --- a/src/gui/painting/qoutlinemapper.cpp +++ b/src/gui/painting/qoutlinemapper.cpp @@ -37,6 +37,24 @@ static const QRectF boundingRect(const QPointF *points, int pointCount) return QRectF(QPointF(minx, miny), QPointF(maxx, maxy)); } +void QOutlineMapper::setClipRect(QRect clipRect) +{ + auto limitCoords = [](QRect r) { + const QRect limitRect(QPoint(-QT_RASTER_COORD_LIMIT, -QT_RASTER_COORD_LIMIT), + QPoint(QT_RASTER_COORD_LIMIT, QT_RASTER_COORD_LIMIT)); + r &= limitRect; + r.setWidth(qMin(r.width(), QT_RASTER_COORD_LIMIT)); + r.setHeight(qMin(r.height(), QT_RASTER_COORD_LIMIT)); + return r; + }; + + if (clipRect != m_clip_rect) { + m_clip_rect = limitCoords(clipRect); + const int mw = 64; // margin width. No need to trigger clipping for slight overshooting + m_clip_trigger_rect = QRectF(limitCoords(m_clip_rect.adjusted(-mw, -mw, mw, mw))); + } +} + void QOutlineMapper::curveTo(const QPointF &cp1, const QPointF &cp2, const QPointF &ep) { #ifdef QT_DEBUG_CONVERT printf("QOutlineMapper::curveTo() (%f, %f)\n", ep.x(), ep.y()); @@ -200,16 +218,8 @@ void QOutlineMapper::endOutline() m_clip_rect.x(), m_clip_rect.y(), m_clip_rect.width(), m_clip_rect.height()); #endif - - // Check for out of dev bounds... - const bool do_clip = !m_in_clip_elements && ((controlPointRect.left() < -QT_RASTER_COORD_LIMIT - || controlPointRect.right() > QT_RASTER_COORD_LIMIT - || controlPointRect.top() < -QT_RASTER_COORD_LIMIT - || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT - || controlPointRect.width() > QT_RASTER_COORD_LIMIT - || controlPointRect.height() > QT_RASTER_COORD_LIMIT)); - - if (do_clip) { + // Avoid rasterizing outside cliprect: faster, and ensures coords < QT_RASTER_COORD_LIMIT + if (!m_in_clip_elements && !m_clip_trigger_rect.contains(controlPointRect)) { clipElements(elements, elementTypes(), m_elements.size()); } else { convertElements(elements, elementTypes(), m_elements.size()); diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h index 372f9b4ec2..1ce82eff0b 100644 --- a/src/gui/painting/qoutlinemapper_p.h +++ b/src/gui/painting/qoutlinemapper_p.h @@ -79,6 +79,8 @@ public: m_curve_threshold = scale == 0 ? qreal(0.25) : (qreal(0.25) / scale); } + void setClipRect(QRect clipRect); + void beginOutline(Qt::FillRule fillRule) { #ifdef QT_DEBUG_CONVERT @@ -163,6 +165,7 @@ public: QDataBuffer<int> m_contours; QRect m_clip_rect; + QRectF m_clip_trigger_rect; QRectF controlPointRect; // only valid after endOutline() QT_FT_Outline m_outline; diff --git a/src/gui/painting/qpageranges.cpp b/src/gui/painting/qpageranges.cpp index 7d62c7c321..500673b22f 100644 --- a/src/gui/painting/qpageranges.cpp +++ b/src/gui/painting/qpageranges.cpp @@ -14,7 +14,7 @@ QT_IMPL_METATYPE_EXTERN(QPageRanges) void QPageRangesPrivate::mergeIntervals() { - const int count = intervals.count(); + const int count = intervals.size(); if (count <= 1) return; @@ -162,7 +162,7 @@ QPageRanges QPageRanges::fromString(const QString &ranges) if (item.contains(u'-')) { const QStringList rangeItems = item.split(u'-'); - if (rangeItems.count() != 2) + if (rangeItems.size() != 2) return QPageRanges(); bool ok; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index d276bcdccd..953999a292 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -277,15 +277,6 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() : */ /*! - \typedef QSpan - \relates QRasterPaintEngine - - A struct equivalent to QT_FT_Span, containing a position (x, - y), the span's length in pixels and its color/coverage (a value - ranging from 0 to 255). -*/ - -/*! \since 4.5 Creates a raster based paint engine for operating on the given @@ -416,13 +407,7 @@ bool QRasterPaintEngine::begin(QPaintDevice *device) QRasterPaintEngineState *s = state(); ensureOutlineMapper(); - d->outlineMapper->m_clip_rect = d->deviceRect; - - if (d->outlineMapper->m_clip_rect.width() > QT_RASTER_COORD_LIMIT) - d->outlineMapper->m_clip_rect.setWidth(QT_RASTER_COORD_LIMIT); - if (d->outlineMapper->m_clip_rect.height() > QT_RASTER_COORD_LIMIT) - d->outlineMapper->m_clip_rect.setHeight(QT_RASTER_COORD_LIMIT); - + d->outlineMapper->setClipRect(d->deviceRect); d->rasterizer->setClipRect(d->deviceRect); s->penData.init(d->rasterBuffer.data(), this); @@ -516,6 +501,7 @@ QRasterPaintEngineState::QRasterPaintEngineState() txscale = 1.; + flag_bits = 0; flags.fast_pen = true; flags.non_complex_pen = false; flags.antialiased = false; @@ -4277,7 +4263,7 @@ protected: void QGradientCache::generateGradientColorTable(const QGradient& gradient, QRgba64 *colorTable, int size, int opacity) const { const QGradientStops stops = gradient.stops(); - int stopCount = stops.count(); + int stopCount = stops.size(); Q_ASSERT(stopCount > 0); bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 0ccfccb19e..e69f369dbe 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -381,7 +381,7 @@ void QPainterPrivate::draw_helper(const QPainterPath &originalPath, DrawOperatio if (q->hasClipping()) { bool hasPerspectiveTransform = false; - for (const QPainterClipInfo &info : qAsConst(state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(state->clipInfo)) { if (info.matrix.type() == QTransform::TxProject) { hasPerspectiveTransform = true; break; @@ -1616,9 +1616,8 @@ void QPainter::restore() tmp->clipPath = QPainterPath(); d->engine->updateState(*tmp); // replay the list of clip states, - for (const QPainterClipInfo &info : qAsConst(d->state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { tmp->matrix = info.matrix; - tmp->matrix *= d->state->redirectionMatrix; tmp->clipOperation = info.operation; if (info.clipType == QPainterClipInfo::RectClip) { tmp->dirtyFlags = QPaintEngine::DirtyClipRegion | QPaintEngine::DirtyTransform; @@ -2478,7 +2477,7 @@ QRegion QPainter::clipRegion() const const_cast<QPainter *>(this)->d_ptr->updateInvMatrix(); // ### Falcon: Use QPainterPath - for (const QPainterClipInfo &info : qAsConst(d->state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { switch (info.clipType) { case QPainterClipInfo::RegionClip: { @@ -2645,7 +2644,7 @@ QRectF QPainter::clipBoundingRect() const // fast. QRectF bounds; bool first = true; - for (const QPainterClipInfo &info : qAsConst(d->state->clipInfo)) { + for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { QRectF r; if (info.clipType == QPainterClipInfo::RectClip) @@ -5454,6 +5453,8 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText if (font() != staticText_d->font || fp == nullptr || stfp == nullptr || fp->dpi != stfp->dpi) { staticText_d->font = font(); staticText_d->needsRelayout = true; + } else if (stfp->engineData == nullptr || stfp->engineData->fontCacheId != QFontCache::instance()->id()) { + staticText_d->needsRelayout = true; } QFontEngine *fe = staticText_d->font.d->engineForScript(QChar::Script_Common); @@ -5591,7 +5592,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif } engine.itemize(); QScriptLine line; - line.length = str.length(); + line.length = str.size(); engine.shapeLine(line); int nItems = engine.layoutData->items.size(); @@ -5646,7 +5647,7 @@ void QPainter::drawText(const QRect &r, int flags, const QString &str, QRect *br Q_D(QPainter); - if (!d->engine || str.length() == 0 || pen().style() == Qt::NoPen) + if (!d->engine || str.size() == 0 || pen().style() == Qt::NoPen) return; if (!d->extended) @@ -5733,7 +5734,7 @@ void QPainter::drawText(const QRectF &r, int flags, const QString &str, QRectF * Q_D(QPainter); - if (!d->engine || str.length() == 0 || pen().style() == Qt::NoPen) + if (!d->engine || str.size() == 0 || pen().style() == Qt::NoPen) return; if (!d->extended) @@ -5852,7 +5853,7 @@ void QPainter::drawText(const QRectF &r, const QString &text, const QTextOption Q_D(QPainter); - if (!d->engine || text.length() == 0 || pen().style() == Qt::NoPen) + if (!d->engine || text.size() == 0 || pen().style() == Qt::NoPen) return; if (!d->extended) @@ -6343,7 +6344,7 @@ QRectF QPainter::boundingRect(const QRectF &r, const QString &text, const QTextO { Q_D(QPainter); - if (!d->engine || text.length() == 0) + if (!d->engine || text.size() == 0) return QRectF(r.x(),r.y(), 0,0); QRectF br; @@ -7133,7 +7134,7 @@ start_lengthVariant: // compatible behaviour to the old implementation. Replace // tabs by spaces int old_offset = offset; - for (; offset < text.length(); offset++) { + for (; offset < text.size(); offset++) { QChar chr = text.at(offset); if (chr == u'\r' || (singleline && chr == u'\n')) { text[offset] = u' '; diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index ed0208772a..848769d5b2 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1938,7 +1938,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font) addXrefEntry(toUnicode); QByteArray touc = font->createToUnicodeMap(); xprintf("<< /Length %d >>\n" - "stream\n", touc.length()); + "stream\n", touc.size()); write(touc); write("\nendstream\n" "endobj\n"); @@ -2280,16 +2280,15 @@ int QPdfEnginePrivate::writeCompressed(const char *src, int len) { #ifndef QT_NO_COMPRESS if (do_compress) { - uLongf destLen = len + len/100 + 13; // zlib requirement - Bytef* dest = new Bytef[destLen]; - if (Z_OK == ::compress(dest, &destLen, (const Bytef*) src, (uLongf)len)) { - stream->writeRawData((const char*)dest, destLen); + const QByteArray data = qCompress(reinterpret_cast<const uchar *>(src), len); + constexpr qsizetype HeaderSize = 4; + if (!data.isNull()) { + stream->writeRawData(data.data() + HeaderSize, data.size() - HeaderSize); + len = data.size() - HeaderSize; } else { qWarning("QPdfStream::writeCompressed: Error in compress()"); - destLen = 0; + len = 0; } - delete [] dest; - len = destLen; } else #endif { @@ -2335,7 +2334,7 @@ int QPdfEnginePrivate::writeImage(const QByteArray &data, int width, int height, //qDebug("DCT"); xprintf("/Filter /DCTDecode\n>>\nstream\n"); write(data); - len = data.length(); + len = data.size(); } else { if (do_compress) xprintf("/Filter /FlateDecode\n>>\nstream\n"); @@ -2666,7 +2665,7 @@ int QPdfEnginePrivate::gradientBrush(const QBrush &b, const QTransform &matrix, "/Shading << /Shader" << alphaShaderObject << alphaShaderObject << "0 R >>\n" ">>\n"; - f << "/Length " << content.length() << "\n" + f << "/Length " << content.size() << "\n" ">>\n" "stream\n" << content @@ -2784,7 +2783,7 @@ int QPdfEnginePrivate::addBrushPattern(const QTransform &m, bool *specifyColor, s << "/XObject << /Im" << imageObject << ' ' << imageObject << "0 R >> "; } s << ">>\n" - "/Length " << pattern.length() << "\n" + "/Length " << pattern.size() << "\n" ">>\n" "stream\n" << pattern diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h index 92a848e0d1..4c6a570e76 100644 --- a/src/gui/painting/qpdf_p.h +++ b/src/gui/painting/qpdf_p.h @@ -293,7 +293,7 @@ private: } int writeCompressed(const char *src, int len); - inline int writeCompressed(const QByteArray &data) { return writeCompressed(data.constData(), data.length()); } + inline int writeCompressed(const QByteArray &data) { return writeCompressed(data.constData(), data.size()); } int writeCompressed(QIODevice *dev); struct AttachmentInfo diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index befd3a4197..8a23003065 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -68,7 +68,7 @@ QPlatformTextureList::~QPlatformTextureList() int QPlatformTextureList::count() const { Q_D(const QPlatformTextureList); - return d->textures.count(); + return d->textures.size(); } QRhiTexture *QPlatformTextureList::texture(int index) const diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h index a1bae50555..270bef9f27 100644 --- a/src/gui/painting/qplatformbackingstore.h +++ b/src/gui/painting/qplatformbackingstore.h @@ -66,22 +66,10 @@ struct Q_GUI_EXPORT QPlatformBackingStoreRhiConfig bool isDebugLayerEnabled() const { return m_debugLayer; } void setDebugLayer(bool enable) { m_debugLayer = enable; } - QByteArrayList instanceExtensions() const { return m_instanceExtensions; } - void setInstanceExtensions(const QByteArrayList &e) { m_instanceExtensions = e; } - - QByteArrayList instanceLayers() const { return m_instanceLayers; } - void setInstanceLayers(const QByteArrayList &e) { m_instanceLayers = e; } - - QByteArrayList deviceExtensions() const { return m_deviceExtensions; } - void setDeviceExtensions(const QByteArrayList &e) { m_deviceExtensions = e; } - private: bool m_enable; Api m_api = Null; bool m_debugLayer = false; - QByteArrayList m_instanceExtensions; - QByteArrayList m_instanceLayers; - QByteArrayList m_deviceExtensions; friend bool operator==(const QPlatformBackingStoreRhiConfig &a, const QPlatformBackingStoreRhiConfig &b); }; @@ -89,10 +77,7 @@ inline bool operator==(const QPlatformBackingStoreRhiConfig &a, const QPlatformB { return a.m_enable == b.m_enable && a.m_api == b.m_api - && a.m_debugLayer == b.m_debugLayer - && a.m_instanceExtensions == b.m_instanceExtensions - && a.m_instanceLayers == b.m_instanceLayers - && a.m_deviceExtensions == b.m_deviceExtensions; + && a.m_debugLayer == b.m_debugLayer; } inline bool operator!=(const QPlatformBackingStoreRhiConfig &a, const QPlatformBackingStoreRhiConfig &b) diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index 99d67599ed..a3a89d7504 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -421,7 +421,7 @@ QDebug operator<<(QDebug dbg, const QPolygon &a) { QDebugStateSaver saver(dbg); dbg.nospace() << "QPolygon("; - for (int i = 0; i < a.count(); ++i) + for (int i = 0; i < a.size(); ++i) dbg.nospace() << a.at(i); dbg.nospace() << ')'; return dbg; @@ -742,7 +742,7 @@ QDebug operator<<(QDebug dbg, const QPolygonF &a) { QDebugStateSaver saver(dbg); dbg.nospace() << "QPolygonF("; - for (int i = 0; i < a.count(); ++i) + for (int i = 0; i < a.size(); ++i) dbg.nospace() << a.at(i); dbg.nospace() << ')'; return dbg; diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 7d912b29e5..3504e44d1d 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -3818,7 +3818,7 @@ QRegion::QRegion(const QRect &r, RegionType t) QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule) { - if (a.count() > 2) { + if (a.size() > 2) { QRegionPrivate *qt_rgn = PolygonRegion(a.constData(), a.size(), fillRule == Qt::WindingFill ? WindingRule : EvenOddRule); if (qt_rgn) { diff --git a/src/gui/painting/qt_attribution.json b/src/gui/painting/qt_attribution.json index 94e748aee7..d0f2468e6a 100644 --- a/src/gui/painting/qt_attribution.json +++ b/src/gui/painting/qt_attribution.json @@ -4,13 +4,13 @@ "Name": "Anti-aliasing rasterizer from FreeType 2", "QDocModule": "qtgui", "QtUsage": "Used in Qt GUI.", - "Path": "qgrayraster.c", + "Files": "qgrayraster.c", "Description": "FreeType is a freely available software library to render fonts.", "Homepage": "http://www.freetype.org", "License": "Freetype Project License or GNU General Public License v2.0 only", "LicenseId": "FTL or GPL-2.0", - "LicenseFile": "../../3rdparty/freetype/LICENSE.TXT", + "LicenseFile": "../../3rdparty/freetype/LICENSE.txt", "Copyright": "Copyright 2000-2016 by David Turner, Robert Wilhelm, and Werner Lemberg." }, { diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 5fa5d04e54..61d78fb607 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1459,7 +1459,7 @@ QRegion QTransform::map(const QRegion &r) const if (!nr.isEmpty()) rects.append(nr); } - res.setRects(rects.constData(), rects.count()); + res.setRects(rects.constData(), rects.size()); } return res; } @@ -1706,7 +1706,7 @@ QPolygon QTransform::mapToPolygon(const QRect &rect) const */ bool QTransform::squareToQuad(const QPolygonF &quad, QTransform &trans) { - if (quad.count() != 4) + if (quad.size() != 4) return false; qreal dx0 = quad[0].x(); |