From 1e1b02ad5b1f8b1f927f9f9ceecd2d01d8f68519 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 13 Jan 2016 20:05:57 +0200 Subject: [PATCH] fix a compiler warning, remove unused functions Signed-off-by: Ivailo Monev --- src/gui/painting/qbackingstore.cpp | 2 ++ src/gui/painting/qdrawhelper.cpp | 51 -------------------------------- src/gui/painting/qpaintengine_raster.cpp | 11 ------- 3 files changed, 2 insertions(+), 62 deletions(-) diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index db0c15c7d..43f3810e8 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE extern QRegion qt_dirtyRegion(QWidget *); +#ifdef Q_BACKINGSTORE_SUBSURFACES /* A version of QRect::intersects() that does not normalize the rects. */ @@ -77,6 +78,7 @@ static inline bool qRectIntersects(const QRect &r1, const QRect &r2) return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); } +#endif /** * Flushes the contents of the \a windowSurface into the screen area of \a widget. diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 2596efad2..c02ba28f7 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -3696,57 +3696,6 @@ Q_STATIC_TEMPLATE_FUNCTION void blend_untransformed_argb(int count, const QSpan } } -static inline quint16 interpolate_pixel_rgb16_255(quint16 x, quint8 a, - quint16 y, quint8 b) -{ - quint16 t = ((((x & 0x07e0) * a) + ((y & 0x07e0) * b)) >> 5) & 0x07e0; - t |= ((((x & 0xf81f) * a) + ((y & 0xf81f) * b)) >> 5) & 0xf81f; - - return t; -} - -static inline quint32 interpolate_pixel_rgb16x2_255(quint32 x, quint8 a, - quint32 y, quint8 b) -{ - uint t; - t = ((((x & 0xf81f07e0) >> 5) * a) + (((y & 0xf81f07e0) >> 5) * b)) & 0xf81f07e0; - t |= ((((x & 0x07e0f81f) * a) + ((y & 0x07e0f81f) * b)) >> 5) & 0x07e0f81f; - return t; -} - -static inline void blend_sourceOver_rgb16_rgb16(quint16 *dest, - const quint16 *src, - int length, - const quint8 alpha, - const quint8 ialpha) -{ - const int dstAlign = ((quintptr)dest) & 0x3; - if (dstAlign) { - *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha); - ++dest; - ++src; - --length; - } - const int srcAlign = ((quintptr)src) & 0x3; - int length32 = length >> 1; - if (length32 && srcAlign == 0) { - while (length32--) { - const quint32 *src32 = reinterpret_cast(src); - quint32 *dest32 = reinterpret_cast(dest); - *dest32 = interpolate_pixel_rgb16x2_255(*src32, alpha, - *dest32, ialpha); - dest += 2; - src += 2; - } - length &= 0x1; - } - while (length--) { - *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha); - ++dest; - ++src; - } -} - template Q_STATIC_TEMPLATE_SPECIALIZATION inline void madd_2(DST *dest, const quint16 alpha, const SRC *src) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index b046edd0a..2370ad483 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2102,17 +2102,6 @@ void QRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, cons } } -// assumes that rect has positive width and height -static inline const QRect toRect_normalized(const QRectF &rect) -{ - const int x = qRound(rect.x()); - const int y = qRound(rect.y()); - const int w = int(rect.width() + qreal(0.5)); - const int h = int(rect.height() + qreal(0.5)); - - return QRect(x, y, w, h); -} - static inline int fast_ceil_positive(const qreal &v) { const int iv = int(v); -- 2.11.0