From 3441738d5f63f2d147bfcd37351be48c66ec5181 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Jun 2014 11:18:47 +0200 Subject: Remove unfinished NEON version of vectorized rotate sampling A vectorized codepath for rotating transforms were added in 5.3.0, but was only properly tested for SSE2. The NEON version remains unfinished. Since it was never working, this patch reverts the NEON version. Task-number: QTBUG-39445 Change-Id: Ifbce0e03781d217ad976c6b18ac88381055cba66 Reviewed-by: Gunnar Sletta --- src/gui/painting/qdrawhelper.cpp | 65 ---------------------------------------- 1 file changed, 65 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index b5ccafdf9a..24da65921e 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -1798,71 +1798,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c } fx = v_fx.i[0]; fy = v_fy.i[0]; -#elif defined(__ARM_NEON__) - BILINEAR_ROTATE_BOUNDS_PROLOG - - const int16x8_t colorMask = vdupq_n_s16(0x00ff); - const int16x8_t invColorMask = vmvnq_s16(colorMask); - const int16x8_t v_256 = vdupq_n_s16(256); - int32x4_t v_fdx = vdupq_n_s32(fdx*4); - int32x4_t v_fdy = vdupq_n_s32(fdy*4); - - const uchar *textureData = data->texture.imageData; - const int bytesPerLine = data->texture.bytesPerLine; - - union Vect_buffer { int32x4_t vect; quint32 i[4]; }; - Vect_buffer v_fx, v_fy; - - for (int i = 0; i < 4; i++) { - v_fx.i[i] = fx; - v_fy.i[i] = fy; - fx += fdx; - fy += fdy; - } - - const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff); - - while (b < boundedEnd) { - if (fdx > 0 && (v_fx.i[3] >> 16) >= image_x2) - break; - if (fdx < 0 && (v_fx.i[3] >> 16) < image_x1) - break; - if (fdy > 0 && (v_fy.i[3] >> 16) >= image_y2) - break; - if (fdy < 0 && (v_fy.i[3] >> 16) < image_y1) - break; - - Vect_buffer tl, tr, bl, br; - - Vect_buffer v_fx_shifted, v_fy_shifted; - v_fx_shifted.vect = vshrq_n_s32(v_fx.vect, 16); - v_fy_shifted.vect = vshrq_n_s32(v_fy.vect, 16); - - for (int i = 0; i < 4; i++) { - const int x1 = v_fx_shifted.i[i]; - const int y1 = v_fy_shifted.i[i]; - const uchar *sl = textureData + bytesPerLine * y1; - const uint *s1 = (const uint *)sl; - const uint *s2 = (const uint *)(sl + bytesPerLine); - tl.i[i] = s1[x1]; - tr.i[i] = s1[x1+1]; - bl.i[i] = s2[x1]; - br.i[i] = s2[x1+1]; - } - - int32x4_t v_distx = vshrq_n_s32(vandq_s32(v_fx.vect, v_ffff_mask), 12); - int32x4_t v_disty = vshrq_n_s32(vandq_s32(v_fy.vect, v_ffff_mask), 12); - v_distx = vorrq_s32(v_distx, vshlq_n_s32(v_distx, 16)); - v_disty = vorrq_s32(v_disty, vshlq_n_s32(v_disty, 16)); - int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4); - - interpolate_4_pixels_16_neon(vreinterpretq_s16_s32(tl.vect), vreinterpretq_s16_s32(tr.vect), vreinterpretq_s16_s32(bl.vect), vreinterpretq_s16_s32(br.vect), vreinterpretq_s16_s32(v_distx), v_disty, v_disty_, colorMask, invColorMask, v_256, b); - b+=4; - v_fx.vect = vaddq_s32(v_fx.vect, v_fdx); - v_fy.vect = vaddq_s32(v_fy.vect, v_fdy); - } - fx = v_fx.i[0]; - fy = v_fy.i[0]; #endif } -- cgit v1.2.3 From 9a3a3b641a11022a69d77840714da13d8c5c4d5e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 5 Jun 2014 23:23:07 +0200 Subject: Don't try to draw if there are no points in the path In some cases, for instance if drawEllipse() was called with a null QRect then it would still try to draw a QVectorPath without having enough points in the list. Therefore the point_count should be checked first before doing any drawing. Change-Id: I9b8dbb87c73b74e9df9eb10ec790a484d05d4c46 Reviewed-by: Gunnar Sletta --- src/gui/painting/qpaintengineex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index e75a59cc91..8487cf2394 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -830,6 +830,8 @@ void QPaintEngineEx::drawEllipse(const QRectF &r) int point_count = 0; x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count); + if (point_count == 0) + return; QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint); draw(vp); } -- cgit v1.2.3 From fbac55fe59db8f16fbe94f79677f53fc47adc6a2 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 9 Jun 2014 22:08:55 +0200 Subject: When filling the path it should use the painter's pen not the state's The state should already be updated when fillPath() is called, so it should use the painter's pen to fill the path with instead as this will have been updated already. Task-number: QTBUG-39303 Change-Id: I1cc9922d4183bd44076c26210db06ad825ebf25b Reviewed-by: Gunnar Sletta --- src/gui/painting/qpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index acab08e794..ba20186d00 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -761,7 +761,7 @@ void QPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) bool((painter()->renderHints() & QPainter::TextAntialiasing) && !(painter()->font().styleStrategy() & QFont::NoAntialias))); painter()->translate(p.x(), p.y()); - painter()->fillPath(path, state->pen().brush()); + painter()->fillPath(path, painter()->pen().brush()); painter()->restore(); } } -- cgit v1.2.3 From 4cf37985e4c7108ff1e28ae875b0ee33c523e8b3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 24 Jun 2014 16:39:50 -0700 Subject: Fix -Werror compilation on big-endian qt_alphamapblit_rgba8888 is only used on little-endian systems, where qAlpha() returns the correct value. qdrawhelper.cpp:6256:13: error: 'void qt_alphamapblit_rgba8888(QRasterBuffer*, int, int, quint32, const uchar*, int, int, int, const QClipData*)' defined but not used [-Werror=unused-function] Change-Id: Ibba6dd6914138f7ae5d53a8e354597f5fff65433 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qdrawhelper.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 24da65921e..9293fc32dc 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6253,6 +6253,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, } } +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN static void qt_alphamapblit_rgba8888(QRasterBuffer *rasterBuffer, int x, int y, quint32 color, const uchar *map, @@ -6261,6 +6262,7 @@ static void qt_alphamapblit_rgba8888(QRasterBuffer *rasterBuffer, { qt_alphamapblit_argb32(rasterBuffer, x, y, ARGB2RGBA(color), map, mapWidth, mapHeight, mapStride, clip); } +#endif static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer, int x, int y, quint32 color, -- cgit v1.2.3