From 1e25b81e0d6c1da4643c9cc48680f5cc4399d068 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 6 Jul 2020 12:34:58 +0200 Subject: Use QList instead of QVector in plugins Task-number: QTBUG-84469 Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp | 4 ++-- src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp | 6 +++--- src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h | 4 ++-- src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp | 8 ++++---- src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp | 8 ++++---- src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp | 4 ++-- src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/plugins/platforms/xcb/nativepainting') diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp index bbc156fc53..5193461273 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp @@ -100,7 +100,7 @@ void QXcbNativeBackingStore::flush(QWindow *window, const QRegion ®ion, const Window wid = platformWindow->xcb_window(); Pixmap pid = qt_x11PixmapHandle(m_pixmap); - QVector clipRects = qt_region_to_xrectangles(clipped); + QList clipRects = qt_region_to_xrectangles(clipped); #if QT_CONFIG(xrender) if (m_translucentBackground) @@ -198,7 +198,7 @@ void QXcbNativeBackingStore::beginPaint(const QRegion ®ion) #if QT_CONFIG(xrender) if (m_translucentBackground) { - const QVector xrects = qt_region_to_xrectangles(region); + const QList xrects = qt_region_to_xrectangles(region); const XRenderColor color = { 0, 0, 0, 0 }; XRenderFillRectangles(display(), PictOpSrc, qt_x11PictureHandle(m_pixmap), &color, diff --git a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp index fe9d1fcde9..b4a9d64eb8 100644 --- a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp @@ -77,8 +77,8 @@ public: uint g_shift; uint b_shift; - QVector colors; - QVector pixels; + QList colors; + QList pixels; }; static uint right_align(uint v) @@ -638,7 +638,7 @@ const QColor QXcbColormap::colorAt(uint pixel) const return QColor(r, g, b); } -const QVector QXcbColormap::colormap() const +const QList QXcbColormap::colormap() const { return d->colors; } QXcbColormap &QXcbColormap::operator=(const QXcbColormap &colormap) diff --git a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h index 573a0f28ea..c4070321de 100644 --- a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h @@ -41,7 +41,7 @@ #define QCOLORMAP_X11_H #include -#include +#include QT_BEGIN_NAMESPACE @@ -69,7 +69,7 @@ public: uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; - const QVector colormap() const; + const QList colormap() const; private: QXcbColormap(); diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp index 77d0caf649..ab0f537926 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp @@ -392,7 +392,7 @@ static inline void x11SetClipRegion(Display *dpy, GC gc, GC gc2, { // int num; // XRectangle *rects = (XRectangle *)qt_getClipRects(r, num); - QVector rects = qt_region_to_xrectangles(r); + QList rects = qt_region_to_xrectangles(r); int num = rects.size(); if (gc) @@ -2129,7 +2129,7 @@ void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRect XSetBackground(d->dpy, cgc, 0); XSetForeground(d->dpy, cgc, 1); if (!d->crgn.isEmpty()) { - QVector rects = qt_region_to_xrectangles(d->crgn); + QList rects = qt_region_to_xrectangles(d->crgn); XSetClipRectangles(d->dpy, cgc, -x, -y, rects.data(), rects.size(), Unsorted); } else if (d->has_clipping) { XSetClipRectangles(d->dpy, cgc, 0, 0, 0, 0, Unsorted); @@ -2152,7 +2152,7 @@ void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRect GC cgc = XCreateGC(d->dpy, comb, 0, 0); XSetForeground(d->dpy, cgc, 0); XFillRectangle(d->dpy, comb, cgc, 0, 0, sw, sh); - QVector rects = qt_region_to_xrectangles(d->crgn); + QList rects = qt_region_to_xrectangles(d->crgn); XSetClipRectangles(d->dpy, cgc, -x, -y, rects.data(), rects.size(), Unsorted); XCopyArea(d->dpy, qt_x11PixmapHandle(pixmap), comb, cgc, sx, sy, sw, sh, 0, 0); XFreeGC(d->dpy, cgc); @@ -2201,7 +2201,7 @@ void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRect if (restore_clip) { XSetClipOrigin(d->dpy, d->gc, 0, 0); - QVector rects = qt_region_to_xrectangles(d->crgn); + QList rects = qt_region_to_xrectangles(d->crgn); if (rects.isEmpty()) XSetClipMask(d->dpy, d->gc, XNone); else diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp index 467e93e64f..d55a49768c 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp @@ -573,7 +573,7 @@ void QX11PlatformPixmap::fromImage(const QImage &img, Qt::ImageConversionFlags f switch (cimage.format()) { case QImage::Format_Indexed8: { - QVector colorTable = cimage.colorTable(); + QList colorTable = cimage.colorTable(); uint *xidata = (uint *)xi->data; for (int y = 0; y < h; ++y) { const uchar *p = cimage.scanLine(y); @@ -676,7 +676,7 @@ void QX11PlatformPixmap::fromImage(const QImage &img, Qt::ImageConversionFlags f const uint bbits = highest_bit(blue_mask) - lowest_bit(blue_mask) + 1; if (d8) { // setup pixel translation - QVector ctable = cimage.colorTable(); + QList ctable = cimage.colorTable(); for (int i=0; i < cimage.colorCount(); i++) { int r = qRed (ctable[i]); int g = qGreen(ctable[i]); @@ -1061,7 +1061,7 @@ void QX11PlatformPixmap::fromImage(const QImage &img, Qt::ImageConversionFlags f int maxpop = 0; int maxpix = 0; uint j = 0; - QVector ctable = cimage.colorTable(); + QList ctable = cimage.colorTable(); for (int i = 0; i < 256; i++) { // init pixel array if (pop[i] > 0) { px->r = qRed (ctable[i]); @@ -2114,7 +2114,7 @@ QImage QX11PlatformPixmap::toImage(const QXImageWrapper &xiWrapper, const QRect } else { image.setColorCount(ncols); // create color table } - QVector colors = QXcbColormap::instance(xinfo.screen()).colormap(); + QList colors = QXcbColormap::instance(xinfo.screen()).colormap(); int j = 0; for (int i=0; i qt_region_to_xrectangles(const QRegion &r) +QList qt_region_to_xrectangles(const QRegion &r) { const int numRects = r.rectCount(); const auto input = r.begin(); - QVector output(numRects); + QList output(numRects); for (int i = 0; i < numRects; ++i) { const QRect &in = input[i]; XRectangle &out = output[i]; diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h index b00ccfcdff..7682be8b4a 100644 --- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h +++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h @@ -55,7 +55,7 @@ class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); -QVector qt_region_to_xrectangles(const QRegion &r); +QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info -- cgit v1.2.3